Skip to content

Commit ad80125

Browse files
committed
minor #61298 Fix tests sensitive to SYMFONY_IDE env var (nicolas-grekas)
This PR was merged into the 6.4 branch. Discussion ---------- Fix tests sensitive to SYMFONY_IDE env var | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Commits ------- 1abe7ad Fix tests sensitive to SYMFONY_IDE env var
2 parents 9b2efc6 + 1abe7ad commit ad80125

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ConfigDebugCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function testParametersValuesAreFullyResolved(bool $debug)
141141
$this->assertStringContainsString('locale: en', $tester->getDisplay());
142142
$this->assertStringContainsString('secret: test', $tester->getDisplay());
143143
$this->assertStringContainsString('cookie_httponly: true', $tester->getDisplay());
144-
$this->assertStringContainsString('ide: '.$debug ? ($_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? 'null') : 'null', $tester->getDisplay());
144+
$this->assertStringContainsString('ide: '.($debug ? ($_ENV['SYMFONY_IDE'] ?? $_SERVER['SYMFONY_IDE'] ?? 'null') : 'null'), $tester->getDisplay());
145145
}
146146

147147
/**

src/Symfony/Component/VarDumper/Tests/Dumper/ContextualizedDumperTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@
1919

2020
/**
2121
* @author Kévin Thérage <therage.kevin@gmail.com>
22+
*
23+
* @backupGlobals
2224
*/
2325
class ContextualizedDumperTest extends TestCase
2426
{
2527
public function testContextualizedCliDumper()
2628
{
29+
$_ENV['SYMFONY_IDE'] = $_SERVER['SYMFONY_IDE'] = '';
2730
$wrappedDumper = new CliDumper('php://output');
2831
$wrappedDumper->setColors(true);
2932

3033
$var = 'example';
31-
$href = \sprintf('file://%s#L%s', __FILE__, 37);
34+
$href = \sprintf('file://%s#L%s', __FILE__, 40);
3235
$dumper = new ContextualizedDumper($wrappedDumper, [new SourceContextProvider()]);
3336
$cloner = new VarCloner();
3437
$data = $cloner->cloneVar($var);

0 commit comments

Comments
 (0)