8000 minor #38077 [WebProfilerBundle] Fix Tests for PHPUnit 9.3 (derrabus) · symfony/symfony@d25ea07 · GitHub
[go: up one dir, main page]

Skip to content

Commit d25ea07

Browse files
committed
minor #38077 [WebProfilerBundle] Fix Tests for PHPUnit 9.3 (derrabus)
This PR was merged into the 4.4 branch. Discussion ---------- [WebProfilerBundle] Fix Tests for PHPUnit 9.3 | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | #37564 | License | MIT | Doc PR | N/A PHPUnit's `logicalXor()` creates an XOR operation for one or multiple constraints. It expects the operands for that operation to be passed as variadic arguments, but this particullar test passes them in a single array. This somewhat works on PHPUnit 8, but fails on PHPUnit 9. This PR fixes the failing test. Commits ------- f290b97 [WebProfilerBundle] Fix Tests on PHPUnit 9.3.
2 parents beb6fd8 + f290b97 commit d25ea07

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Bundle/WebProfilerBundle/Tests/Controller/ProfilerControllerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,12 @@ public function testDefaultPanel(string $expectedPanel, Profile $profile)
382382
->with($profile->getToken())
383383
->willReturn($profile);
384384

385+
$collectorsNames = array_keys($profile->getCollectors());
386+
385387
$profiler
386388
->expects($this->atLeastOnce())
387389
->method('has')
388-
->with($this->logicalXor($collectorsNames = array_keys($profile->getCollectors())))
390+
->with($this->logicalXor(...$collectorsNames))
389391
->willReturn(true);
390392

391393
$expectedTemplate = 'expected_template.html.twig';

0 commit comments

Comments
 (0)
0