Skip to content

Commit d533f2e

Browse files
Merge branch '7.4' into 8.0
* 7.4: [PhpUnitBridge] Fix gathering deprecation in phpt
2 parents b230059 + 8468717 commit d533f2e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Legacy/SymfonyTestsListenerTrait.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use PHPUnit\Framework\TestCase;
1818
use PHPUnit\Framework\TestSuite;
1919
use PHPUnit\Runner\BaseTestRunner;
20+
use PHPUnit\Runner\PhptTestCase;
2021
use PHPUnit\Util\Blacklist;
2122
use PHPUnit\Util\ExcludeList;
2223
use PHPUnit\Util\Test;
@@ -197,6 +198,12 @@ public function addSkippedTest($test, \Exception $e, $time): void
197198

198199
public function startTest($test): void
199200
{
201+
if (-2 < $this->state && $test instanceof PhptTestCase) {
202+
$this->runsInSeparateProcess = tempnam(sys_get_temp_dir(), 'deprec');
203+
putenv('SYMFONY_DEPRECATIONS_SERIALIZE='.$this->runsInSeparateProcess);
204+
putenv('SYMFONY_EXPECTED_DEPRECATIONS_SERIALIZE='.tempnam(sys_get_temp_dir(), 'expectdeprec'));
205+
}
206+
200207
if (-2 < $this->state && $test instanceof TestCase) {
201208
// This event is triggered before the test is re-run in isolation
202209
if ($this->willBeIsolated($test)) {

0 commit comments

Comments
 (0)