Skip to content

Commit 8468717

Browse files
Merge branch '7.3' into 7.4
* 7.3: [PhpUnitBridge] Fix gathering deprecation in phpt
2 parents b276908 + b9d9ed2 commit 8468717

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
@@ -18,6 +18,7 @@
1818
use PHPUnit\Framework\TestCase;
1919
use PHPUnit\Framework\TestSuite;
2020
use PHPUnit\Runner\BaseTestRunner;
21+
use PHPUnit\Runner\PhptTestCase;
2122
use PHPUnit\Util\Blacklist;
2223
use PHPUnit\Util\ExcludeList;
2324
use PHPUnit\Util\Test;
@@ -206,6 +207,12 @@ public function addSkippedTest($test, \Exception $e, $time): void
206207

207208
public function startTest($test): void
208209
{
210+
if (-2 < $this->state && $test instanceof PhptTestCase) {
211+
$this->runsInSeparateProcess = tempnam(sys_get_temp_dir(), 'deprec');
212+
putenv('SYMFONY_DEPRECATIONS_SERIALIZE='.$this->runsInSeparateProcess);
213+
putenv('SYMFONY_EXPECTED_DEPRECATIONS_SERIALIZE='.tempnam(sys_get_temp_dir(), 'expectdeprec'));
214+
}
215+
209216
if (-2 < $this->state && $test instanceof TestCase) {
210217
// This event is triggered before the test is re-run in isolation
211218
if ($this->willBeIsolated($test)) {

0 commit comments

Comments
 (0)