Skip to content

Commit c501265

Browse files
Fix using SYMFONY_IDE in tests
1 parent 5b0af9d commit c501265

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Tests/Debug/FileLinkFormatterTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ public function testWhenNoFileLinkFormatAndNoRequest()
2727

2828
public function testAfterUnserialize()
2929
{
30+
$ide = $_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? null;
31+
$_ENV['SYMFONY_IDE'] = $_SERVER['SYMFONY_IDE'] = null;
3032
$sut = unserialize(serialize(new FileLinkFormatter()));
3133

3234
$this->assertFalse($sut->format('/kernel/root/src/my/very/best/file.php', 3));
35+
36+
if (null === $ide) {
37+
unset($_ENV['SYMFONY_IDE'], $_SERVER['SYMFONY_IDE']);
38+
} else {
39+
$_ENV['SYMFONY_IDE'] = $_SERVER['SYMFONY_IDE'] = $ide;
40+
}
3341
}
3442

3543
public function testWhenFileLinkFormatAndNoRequest()

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
>
1111
<php>
1212
<ini name="error_reporting" value="-1" />
13-
<env name="SYMFONY_IDE" value="" force="true" />
1413
</php>
1514

1615
<testsuites>

0 commit comments

Comments
 (0)