From 6b7172239250ace33b957d1616c199bd8f72a22a Mon Sep 17 00:00:00 2001 From: Roland Franssen Date: Tue, 4 Apr 2017 11:33:43 +0200 Subject: [PATCH] [Console] Fix render exception test --- src/Symfony/Component/Console/Tests/ApplicationTest.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index e12922da35..072f0d0b88 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -588,11 +588,9 @@ class ApplicationTest extends TestCase public function testRenderExceptionEscapesLines() { - $application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock(); + $application = new Application(); $application->setAutoExit(false); - $application->expects($this->any()) - ->method('getTerminalWidth') - ->will($this->returnValue(22)); + putenv('COLUMNS=22'); $application->register('foo')->setCode(function () { throw new \Exception('dont break here !'); }); @@ -600,6 +598,7 @@ class ApplicationTest extends TestCase $tester->run(array('command' => 'foo'), array('decorated' => false)); $this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting'); + putenv('COLUMNS=120'); } public function testRun()