Skip to content

Commit

Permalink
[Console] Mock terminal size to prevent formatting errors on small te…
Browse files Browse the repository at this point in the history
…rminals
  • Loading branch information
Seldaek committed Apr 6, 2012
1 parent 1387415 commit 8a2b115
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/Symfony/Tests/Component/Console/ApplicationTest.php
Expand Up @@ -201,8 +201,11 @@ public function testFind()

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);
Expand Down Expand Up @@ -237,8 +240,11 @@ public function testAsXml()

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));
Expand Down

0 comments on commit 8a2b115

Please sign in to comment.