8000 Add test for search in non-interactive mode with multiple results · symfony/symfony@bde4521 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit bde4521

Browse files
committed
Add test for search in non-interactive mode with multiple results
1 parent 2ae4b5f commit bde4521

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/RouterDebugCommandTest.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Bundle\FrameworkBundle\Console\Application;
1515
use Symfony\Component\Console\Tester\CommandTester;
16+
use function PHPUnit\Framework\assertSame;
1617

1718
/**
1819
* @group functional
@@ -61,6 +62,23 @@ public function testSearchMultipleRoutes()
6162
$this->assertStringContainsString('/test', $tester->getDisplay());
6263
}
6364

65+
public function testSearchMultipleRoutesWithoutInteraction()
66+
{
67+
$tester = $this->createCommandTester();
68+
$ret = $tester->execute(['name' => 'routerdebug'], ['interactive' => false]);
69+
70+
$this->assertSame(0, $ret, 'Returns 0 in case of success');
71+
$this->assertStringNotContainsString('Select one of the matching routes:', $tester->getDisplay());
72+
$this->assertStringContainsString('routerdebug_session_welcome', $tester->getDisplay());
73+
$this->assertStringContainsString('/session', $tester->getDisplay());
74+
$this->assertStringContainsString('routerdebug_session_welcome_name', $tester->getDisplay());
75+
$this->assertStringContainsString('/session/{name} ', $tester->getDisplay());
76+
$this->assertStringContainsString('routerdebug_session_logout', $tester->getDisplay());
77+
$this->assertStringContainsString('/session_logout', $tester->getDisplay());
78+
$this->assertStringContainsString('routerdebug_test', $tester->getDisplay());
79+
$this->assertStringContainsString('/test', $tester->getDisplay());
80+
}
81+
6482
public function testSearchWithThrow()
6583
{
6684
$this->expectException(\InvalidArgumentException::class);

0 commit comments

Comments
 (0)
0