Skip to content

Commit 4199103

Browse files
author
Amrouche Hamza
committed
[Console] fix console test
1 parent 234d63f commit 4199103

File tree

1 file changed

+7
-23
lines changed

1 file changed

+7
-23
lines changed

Tests/ApplicationTest.php

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -485,18 +485,10 @@ public function testCanRunAlternativeCommandName()
485485
$tester = new ApplicationTester($application);
486486
$tester->setInputs(array('y'));
487487
$tester->run(array('command' => 'foos'), array('decorated' => false));
488-
$this->assertSame(<<<OUTPUT
489-
490-
491-
Command "foos" is not defined.
492-
493-
494-
Do you want to run "foo" instead? (yes/no) [no]:
495-
>
496-
called
497-
498-
OUTPUT
499-
, $tester->getDisplay(true));
488+
$display = trim($tester->getDisplay(true));
489+
$this->assertContains('Command "foos" is not defined', $display);
490+
$this->assertContains('Do you want to run "foo" instead? (yes/no) [no]:', $display);
491+
$this->assertContains('called', $display);
500492
}
501493

502494
public function testDontRunAlternativeCommandName()
@@ -508,17 +500,9 @@ public function testDontRunAlternativeCommandName()
508500
$tester->setInputs(array('n'));
509501
$exitCode = $tester->run(array('command' => 'foos'), array('decorated' => false));
510502
$this->assertSame(1, $exitCode);
511-
$this->assertSame(<<<OUTPUT
512-
513-
514-
Command "foos" is not defined.
515-
516-
517-
Do you want to run "foo" instead? (yes/no) [no]:
518-
>
519-
520-
OUTPUT
521-
, $tester->getDisplay(true));
503+
$display = trim($tester->getDisplay(true));
504+
$this->assertContains('Command "foos" is not defined', $display);
505+
$this->assertContains('Do you want to run "foo" instead? (yes/no) [no]:', $display);
522506
}
523507

524508
public function provideInvalidCommandNamesSingle()

0 commit comments

Comments
 (0)