diff --git a/composer.json b/composer.json index a478a0b4..5675fd0e 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "nunomaduro/termwind": "^2.0.1", "pestphp/pest-plugin": "^3.0.0", "pestphp/pest-plugin-arch": "^3.0.0", - "phpunit/phpunit": "^11.2.5" + "phpunit/phpunit": "^11.2.6" }, "conflict": { "sebastian/exporter": "<6.0.0", diff --git a/src/PendingCalls/BeforeEachCall.php b/src/PendingCalls/BeforeEachCall.php index 48e093e7..14d52b81 100644 --- a/src/PendingCalls/BeforeEachCall.php +++ b/src/PendingCalls/BeforeEachCall.php @@ -62,12 +62,17 @@ final class BeforeEachCall $testCaseProxies = $this->testCaseProxies; $beforeEachTestCall = function (TestCall $testCall) use ($describing): void { - if ($describing !== $this->describing) { - return; - } - if ($describing !== $testCall->describing) { - return; + + if ($this->describing !== null) { + if ($describing !== $this->describing) { + return; + } + + if ($describing !== $testCall->describing) { + return; + } } + $this->testCallProxies->chain($testCall); }; diff --git a/src/Support/Coverage.php b/src/Support/Coverage.php index e0794522..869d7df2 100644 --- a/src/Support/Coverage.php +++ b/src/Support/Coverage.php @@ -197,7 +197,7 @@ final class Coverage }; $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); } diff --git a/tests/.snapshots/success.txt b/tests/.snapshots/success.txt index 6e00cb57..eb212ade 100644 --- a/tests/.snapshots/success.txt +++ b/tests/.snapshots/success.txt @@ -1012,6 +1012,7 @@ // This is before each runtime note // This is a runtime note ✓ nested → it may have static note and runtime note + // This is before each static note // This is describe static note // This is a static note within describe // This is before each runtime note @@ -1500,4 +1501,4 @@ WARN Tests\Visual\Version - 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) \ No newline at end of file + Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1057 passed (2588 assertions) \ No newline at end of file