Adds a method for getting all filenames

This commit is contained in:
luke
2021-08-13 10:26:38 +01:00
parent c2070cd99d
commit d9749ca65b
2 changed files with 23 additions and 1 deletions

View File

@ -29,7 +29,7 @@ final class TestRepository
/**
* @var array<string, TestCaseFactory>
*/
public $state = [];
private $state = [];
/**
* @var array<string, array<int, array<int, string|Closure>>>
@ -44,6 +44,16 @@ final class TestRepository
return count($this->state);
}
/**
* @return array<int, string>
*/
public function getFilenames(): array
{
return array_values(array_map(function (TestCaseFactory $factory): string {
return $factory->filename;
}, $this->state));
}
/**
* Calls the given callable foreach test case.
*/