The getFilenames method now respects only calls.

This commit is contained in:
luke
2021-08-13 11:07:52 +01:00
parent b6c06e8c30
commit 5c84b0c6d3
3 changed files with 35 additions and 5 deletions

View File

@ -34,3 +34,18 @@ it('can return an array of all test suite filenames', function () {
__FILE__,
]);
});
it('can filter the test suite filenames to those with the only method', function () {
$testSuite = new TestSuite(getcwd(), 'tests');
$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__,
]);
});