Fixes --dirty integration

This commit is contained in:
Luke Downing
2023-02-10 10:22:49 +00:00
committed by Nuno Maduro
parent 17cda168e1
commit aff11486b2

View File

@ -125,6 +125,12 @@ final class TestRepository
*/ */
public function set(TestCaseMethodFactory $method): void public function set(TestCaseMethodFactory $method): void
{ {
foreach ($this->testCaseFilters as $filter) {
if (!$filter->accept($method->filename)) {
return;
}
}
foreach ($this->testCaseMethodFilters as $filter) { foreach ($this->testCaseMethodFilters as $filter) {
if (!$filter->accept($method)) { if (!$filter->accept($method)) {
return; return;
@ -147,17 +153,15 @@ final class TestRepository
return; return;
} }
$accepted = array_reduce( foreach ($this->testCaseFilters as $filter) {
$this->testCaseFilters, if (!$filter->accept($filename)) {
fn (bool $carry, TestCaseFilter $filter): bool => $carry && $filter->accept($filename), return;
true,
);
if ($accepted) {
$this->make($this->testCases[$filename]);
} }
} }
$this->make($this->testCases[$filename]);
}
/** /**
* Makes a Test Case using the given factory. * Makes a Test Case using the given factory.
*/ */