Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bde4521

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

File tree

1 file changed

+18
-0
lines changed
Filter options

1 file changed

+18
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Functional/RouterDebugCommandTest.php
+18Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.