[Console] Mock terminal size to prevent formatting errors on small terminals

This commit is contained in:
Jordi Boggiano 2012-04-06 18:24:40 +02:00
parent 1387415ec3
commit 8a2b115824

View File

@ -201,8 +201,11 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testSetCatchExceptions()
{
$application = new Application();
$application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
$application->setAutoExit(false);
$application->expects($this->any())
->method('getTerminalWidth')
->will($this->returnValue(120));
$tester = new ApplicationTester($application);
$application->setCatchExceptions(true);
@ -237,8 +240,11 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
public function testRenderException()
{
$application = new Application();
$application = $this->getMock('Symfony\Component\Console\Application', array('getTerminalWidth'));
$application->setAutoExit(false);
$application->expects($this->any())
->method('getTerminalWidth')
->will($this->returnValue(120));
$tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'), array('decorated' => false));