Skip to content

Commit 23ee904

Browse files
Merge branch '7.3' into 7.4
* 7.3: [PhpUnitBridge] Fix gathering deprecation in phpt
2 parents 58ab82c + 162cd43 commit 23ee904

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/Symfony/Bridge/PhpUnit/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)) {

src/Symfony/Component/String/Tests/LazyStringTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use PHPUnit\Framework\Attributes\RunInSeparateProcess;
1515
use PHPUnit\Framework\TestCase;
16-
use Symfony\Component\ErrorHandler\ErrorHandler;
1716
use Symfony\Component\String\LazyString;
1817

1918
class LazyStringTest extends TestCase
@@ -33,8 +32,6 @@ public function testLazyString()
3332
#[RunInSeparateProcess]
3433
public function testReturnTypeError()
3534
{
36-
ErrorHandler::register();
37-
3835
$s = LazyString::fromCallable(fn () => []);
3936

4037
$this->expectException(\TypeError::class);

src/Symfony/Component/String/composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
"symfony/polyfill-mbstring": "~1.0"
2525
},
2626
"require-dev": {
27-
"symfony/error-handler": "^6.4|^7.0|^8.0",
2827
"symfony/emoji": "^7.1|^8.0",
2928
"symfony/http-client": "^6.4|^7.0|^8.0",
3029
"symfony/intl": "^6.4|^7.0|^8.0",

0 commit comments

Comments
 (0)