mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
feat: deprecates only feature
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
use Pest\Exceptions\DatasetMissing;
|
||||
use Pest\Exceptions\TestAlreadyExist;
|
||||
use Pest\Factories\TestCaseMethodFactory;
|
||||
use Pest\Plugins\Environment;
|
||||
use Pest\TestSuite;
|
||||
|
||||
it('does not allow to add the same test description twice', function () {
|
||||
@ -40,39 +39,3 @@ it('can return an array of all test suite filenames', function () {
|
||||
'c',
|
||||
]);
|
||||
});
|
||||
|
||||
it('can filter the test suite filenames to those with the only method', function () {
|
||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
||||
|
||||
$testWithOnly = new TestCaseMethodFactory('a', 'b', null);
|
||||
$testWithOnly->only = true;
|
||||
$testSuite->tests->set($testWithOnly);
|
||||
|
||||
$testSuite->tests->set(new TestCaseMethodFactory('c', 'd', null));
|
||||
|
||||
expect($testSuite->tests->getFilenames())->toEqual([
|
||||
'a',
|
||||
]);
|
||||
});
|
||||
|
||||
it('does not filter the test suite filenames to those with the only method when working in CI pipeline', function () {
|
||||
$previousEnvironment = Environment::name();
|
||||
Environment::name(Environment::CI);
|
||||
$testSuite = new TestSuite(getcwd(), 'tests');
|
||||
|
||||
$test = function () {
|
||||
};
|
||||
|
||||
$testWithOnly = new TestCaseMethodFactory('a', 'b', null);
|
||||
$testWithOnly->only = true;
|
||||
$testSuite->tests->set($testWithOnly);
|
||||
|
||||
$testSuite->tests->set(new TestCaseMethodFactory('c', 'd', null));
|
||||
|
||||
expect($testSuite->tests->getFilenames())->toEqual([
|
||||
'a',
|
||||
'c',
|
||||
]);
|
||||
|
||||
Environment::name($previousEnvironment);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user