mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
Adds a method for getting all filenames
This commit is contained in:
@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user