From 965e472acb9c7bee0677f92c82e119b65b71c982 Mon Sep 17 00:00:00 2001 From: Amrouche Hamza Date: Fri, 23 Feb 2018 11:13:19 +0100 Subject: [PATCH] [Console] fix console test --- .../Console/Tests/ApplicationTest.php | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 2c36acb651a60..1444ffe1a475b 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -485,18 +485,10 @@ public function testCanRunAlternativeCommandName() $tester = new ApplicationTester($application); $tester->setInputs(array('y')); $tester->run(array('command' => 'foos'), array('decorated' => false)); - $this->assertSame(<< -called - -OUTPUT -, $tester->getDisplay(true)); + $display = trim($tester->getDisplay(true)); + $this->assertContains('Command "foos" is not defined', $display); + $this->assertContains('Do you want to run "foo" instead? (yes/no) [no]:', $display); + $this->assertContains('called', $display); } public function testDontRunAlternativeCommandName() @@ -508,17 +500,9 @@ public function testDontRunAlternativeCommandName() $tester->setInputs(array('n')); $exitCode = $tester->run(array('command' => 'foos'), array('decorated' => false)); $this->assertSame(1, $exitCode); - $this->assertSame(<< - -OUTPUT - , $tester->getDisplay(true)); + $display = trim($tester->getDisplay(true)); + $this->assertContains('Command "foos" is not defined', $display); + $this->assertContains('Do you want to run "foo" instead? (yes/no) [no]:', $display); } public function provideInvalidCommandNamesSingle()