[Console] Add placeholder for line number in console exception fixtures

This commit is contained in:
Pierre du Plessis 2018-01-15 14:24:34 +02:00 committed by Robin Chalas
parent 3a7099c0e2
commit 686d4f7043
6 changed files with 10 additions and 10 deletions

View File

@ -728,10 +728,10 @@ class ApplicationTest extends TestCase
$tester = new ApplicationTester($application); $tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true)); $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
$tester->run(array('command' => 'foo'), array('decorated' => true, 'capture_stderr_separately' => true)); $tester->run(array('command' => 'foo'), array('decorated' => true, 'capture_stderr_separately' => true));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions'); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
$application = new Application(); $application = new Application();
$application->setAutoExit(false); $application->setAutoExit(false);
@ -741,7 +741,7 @@ class ApplicationTest extends TestCase
}); });
$tester = new ApplicationTester($application); $tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true)); $tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal'); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal');
putenv('COLUMNS=120'); putenv('COLUMNS=120');
} }
@ -756,7 +756,7 @@ class ApplicationTest extends TestCase
$tester = new ApplicationTester($application); $tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'), array('decorated' => false)); $tester->run(array('command' => 'foo'), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting'); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting');
putenv('COLUMNS=120'); putenv('COLUMNS=120');
} }
@ -773,7 +773,7 @@ class ApplicationTest extends TestCase
$tester = new ApplicationTester($application); $tester = new ApplicationTester($application);
$tester->run(array('command' => 'foo'), array('decorated' => false)); $tester->run(array('command' => 'foo'), array('decorated' => false));
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks'); $this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks');
} }
public function testRun() public function testRun()

View File

@ -1,5 +1,5 @@
In ApplicationTest.php line 726: In ApplicationTest.php line %d:
エラーメッセージ エラーメッセージ

View File

@ -1,5 +1,5 @@
In ApplicationTest.php line 726: In ApplicationTest.php line %d:
   
 エラーメッセージ   エラーメッセージ 
   

View File

@ -1,5 +1,5 @@
In ApplicationTest.php line 740: In ApplicationTest.php line %d:
コマンドの実行中にエラーが コマンドの実行中にエラーが
発生しました。 発生しました。

View File

@ -1,5 +1,5 @@
In ApplicationTest.php line 754: In ApplicationTest.php line %d:
dont break here < dont break here <
info>!</info> info>!</info>

View File

@ -1,5 +1,5 @@
In ApplicationTest.php line 771: In ApplicationTest.php line %d:
line 1 with extra spaces line 1 with extra spaces
line 2 line 2