mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 15:57:21 +01:00
adds test for CI env runs
This commit is contained in:
@ -648,6 +648,7 @@
|
|||||||
✓ it alerts users about tests with arguments but no input
|
✓ it alerts users about tests with arguments but no input
|
||||||
✓ it can return an array of all test suite filenames
|
✓ it can return an array of all test suite filenames
|
||||||
✓ it can filter the test suite filenames to those with the only method
|
✓ it can filter the test suite filenames to those with the only method
|
||||||
|
✓ it does not filter the test suite filenames to those with the only method when working in CI pipeline
|
||||||
|
|
||||||
PASS Tests\Visual\Help
|
PASS Tests\Visual\Help
|
||||||
✓ visual snapshot of help command output
|
✓ visual snapshot of help command output
|
||||||
@ -681,5 +682,5 @@
|
|||||||
✓ it is a test
|
✓ it is a test
|
||||||
✓ it uses correct parent class
|
✓ it uses correct parent class
|
||||||
|
|
||||||
Tests: 4 incompleted, 9 skipped, 447 passed
|
Tests: 4 incompleted, 9 skipped, 448 passed
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ it('alerts users about tests with arguments but no input', function () {
|
|||||||
);
|
);
|
||||||
|
|
||||||
it('can return an array of all test suite filenames', function () {
|
it('can return an array of all test suite filenames', function () {
|
||||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
$testSuite = TestSuite::getInstance(getcwd(), 'tests');
|
||||||
$test = function () {};
|
$test = function () {};
|
||||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test));
|
||||||
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'bar', $test));
|
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory(__FILE__, 'bar', $test));
|
||||||
@ -36,7 +36,7 @@ it('can return an array of all test suite filenames', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('can filter the test suite filenames to those with the only method', function () {
|
it('can filter the test suite filenames to those with the only method', function () {
|
||||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
$testSuite = TestSuite::getInstance(getcwd(), 'tests');
|
||||||
$test = function () {};
|
$test = function () {};
|
||||||
|
|
||||||
$testWithOnly = new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test);
|
$testWithOnly = new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test);
|
||||||
@ -49,3 +49,20 @@ it('can filter the test suite filenames to those with the only method', function
|
|||||||
__FILE__,
|
__FILE__,
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('does not filter the test suite filenames to those with the only method when working in CI pipeline', function(){
|
||||||
|
$testSuite = TestSuite::getInstance(getcwd(), 'tests', 'ci');
|
||||||
|
|
||||||
|
$test = function () {};
|
||||||
|
|
||||||
|
$testWithOnly = new \Pest\Factories\TestCaseFactory(__FILE__, 'foo', $test);
|
||||||
|
$testWithOnly->only = true;
|
||||||
|
$testSuite->tests->set($testWithOnly);
|
||||||
|
|
||||||
|
$testSuite->tests->set(new \Pest\Factories\TestCaseFactory('Baz/Bar/Boo.php', 'bar', $test));
|
||||||
|
|
||||||
|
expect($testSuite->tests->getFilenames())->toEqual([
|
||||||
|
__FILE__,
|
||||||
|
'Baz/Bar/Boo.php',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user