8000 [Console] Fix render exception test · symfony/symfony@6b71722 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6b71722

Browse files
ro0NLfabpot
authored andcommitted
[Console] Fix render exception test
1 parent ccbbff2 commit 6b71722

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Symfony/Component/Console/Tests/ApplicationTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -588,18 +588,17 @@ public function testRenderExceptionWithDoubleWidthCharacters()
588588

589589
public function testRenderExceptionEscapesLines()
590590
{
591-
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock();
591+
$application = new Application();
592592
$application->setAutoExit(false);
593-
$application->expects($this->any())
594-
->method('getTerminalWidth')
595-
->will($this->returnValue(22));
593+
putenv('COLUMNS=22');
596594
$application->register('foo')->setCode(function () {
597595
throw new \Exception('dont break here <info>!</info>');
598596
});
599597
$tester = new ApplicationTester($application);
600598

601599
$tester->run(array('command' => 'foo'), array('decorated' => false));
602600
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting');
601+
putenv('COLUMNS=120');
603602
}
604603

605604
public function testRun()

0 commit comments

Comments
 (0)
0