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
-------

f290b97d4f [WebProfilerBundle] Fix Tests on PHPUnit 9.3.
This commit is contained in:
Fabien Potencier 2020-09-07 07:04:20 +02:00
commit d25ea073da

View File

@ -382,10 +382,12 @@ class ProfilerControllerTest extends WebTestCase
->with($profile->getToken())
->willReturn($profile);
$collectorsNames = array_keys($profile->getCollectors());
$profiler
->expects($this->atLeastOnce())
->method('has')
->with($this->logicalXor($collectorsNames = array_keys($profile->getCollectors())))
->with($this->logicalXor(...$collectorsNames))
->willReturn(true);
$expectedTemplate = 'expected_template.html.twig';