Skip to content

Commit 069236e

Browse files
author
Robin Chalas
committed
minor symfony#25794 [Console] Add placeholder for line number in console exception fixtures (pierredup)
This PR was squashed before being merged into the 3.4 branch (closes symfony#25794). Discussion ---------- [Console] Add placeholder for line number in console exception fixtures | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Add placeholders for exception line numbers for tests in `ApplicationTest` to make the tests more flexible Commits ------- 686d4f7 [Console] Add placeholder for line number in console exception fixtures
2 parents 3a7099c + 686d4f7 commit 069236e

6 files changed

+10
-10
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -728,10 +728,10 @@ public function testRenderExceptionWithDoubleWidthCharacters()
728728
$tester = new ApplicationTester($application);
729729

730730
$tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
731-
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
731+
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
732732

733733
$tester->run(array('command' => 'foo'), array('decorated' => true, 'capture_stderr_separately' => true));
734-
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
734+
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth1decorated.txt', $tester->getErrorOutput(true), '->renderException() renders a pretty exceptions with previous exceptions');
735735

736736
$application = new Application();
737737
$application->setAutoExit(false);
@@ -741,7 +741,7 @@ public function testRenderExceptionWithDoubleWidthCharacters()
741741
});
742742
$tester = new ApplicationTester($application);
743743
$tester->run(array('command' => 'foo'), array('decorated' => false, 'capture_stderr_separately' => true));
744-
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal');
744+
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_doublewidth2.txt', $tester->getErrorOutput(true), '->renderException() wraps messages when they are bigger than the terminal');
745745
putenv('COLUMNS=120');
746746
}
747747

@@ -756,7 +756,7 @@ public function testRenderExceptionEscapesLines()
756756
$tester = new ApplicationTester($application);
757757

758758
$tester->run(array('command' => 'foo'), array('decorated' => false));
759-
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting');
759+
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting');
760760
putenv('COLUMNS=120');
761761
}
762762

@@ -773,7 +773,7 @@ public function testRenderExceptionLineBreaks()
773773
$tester = new ApplicationTester($application);
774774

775775
$tester->run(array('command' => 'foo'), array('decorated' => false));
776-
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks');
776+
$this->assertStringMatchesFormatFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks');
777777
}
778778

779779
public function testRun()

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
In ApplicationTest.php line 726:
2+
In ApplicationTest.php line %d:
33

44
エラーメッセージ
55

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth1decorated.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
In ApplicationTest.php line 726:
2+
In ApplicationTest.php line %d:
33
 
44
 エラーメッセージ 
55
 

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_doublewidth2.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
In ApplicationTest.php line 740:
2+
In ApplicationTest.php line %d:
33

44
コマンドの実行中にエラーが
55
発生しました。

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_escapeslines.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
In ApplicationTest.php line 754:
2+
In ApplicationTest.php line %d:
33

44
dont break here <
55
info>!</info>

src/Symfony/Component/Console/Tests/Fixtures/application_renderexception_linebreaks.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
In ApplicationTest.php line 771:
2+
In ApplicationTest.php line %d:
33

44
line 1 with extra spaces
55
line 2

0 commit comments

Comments
 (0)