fix: before each globally

This commit is contained in:
Nuno Maduro
2024-07-03 22:15:11 +01:00
parent 29787d1ff1
commit 1c4bc8b1dc
4 changed files with 14 additions and 8 deletions

View File

@ -23,7 +23,7 @@
"nunomaduro/termwind": "^2.0.1", "nunomaduro/termwind": "^2.0.1",
"pestphp/pest-plugin": "^3.0.0", "pestphp/pest-plugin": "^3.0.0",
"pestphp/pest-plugin-arch": "^3.0.0", "pestphp/pest-plugin-arch": "^3.0.0",
"phpunit/phpunit": "^11.2.5" "phpunit/phpunit": "^11.2.6"
}, },
"conflict": { "conflict": {
"sebastian/exporter": "<6.0.0", "sebastian/exporter": "<6.0.0",

View File

@ -62,12 +62,17 @@ final class BeforeEachCall
$testCaseProxies = $this->testCaseProxies; $testCaseProxies = $this->testCaseProxies;
$beforeEachTestCall = function (TestCall $testCall) use ($describing): void { $beforeEachTestCall = function (TestCall $testCall) use ($describing): void {
if ($this->describing !== null) {
if ($describing !== $this->describing) { if ($describing !== $this->describing) {
return; return;
} }
if ($describing !== $testCall->describing) { if ($describing !== $testCall->describing) {
return; return;
} }
}
$this->testCallProxies->chain($testCall); $this->testCallProxies->chain($testCall);
}; };

View File

@ -197,7 +197,7 @@ final class Coverage
}; };
$array = []; $array = [];
foreach (array_filter($file->lineCoverageData(), 'is_array') as $line => $tests) { foreach (array_filter($file->lineCoverageData(), is_array(...)) as $line => $tests) {
$array = $eachLine($array, $tests, $line); $array = $eachLine($array, $tests, $line);
} }

View File

@ -1012,6 +1012,7 @@
// This is before each runtime note // This is before each runtime note
// This is a runtime note // This is a runtime note
✓ nested → it may have static note and runtime note ✓ nested → it may have static note and runtime note
// This is before each static note
// This is describe static note // This is describe static note
// This is a static note within describe // This is a static note within describe
// This is before each runtime note // This is before each runtime note
@ -1500,4 +1501,4 @@
WARN Tests\Visual\Version WARN Tests\Visual\Version
- visual snapshot of help command output - visual snapshot of help command output
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1057 passed (2588 assertions, 18 notes) Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1057 passed (2588 assertions)