13
13
14
14
use Symfony \Bundle \FrameworkBundle \Console \Application ;
15
15
use Symfony \Component \Console \Tester \CommandTester ;
16
+ use function PHPUnit \Framework \assertSame ;
16
17
17
18
/**
18
19
* @group functional
@@ -61,6 +62,23 @@ public function testSearchMultipleRoutes()
61
62
$ this ->assertStringContainsString ('/test ' , $ tester ->getDisplay ());
62
63
}
63
64
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
+
64
82
public function testSearchWithThrow ()
65
83
{
66
84
$ this ->expectException (\InvalidArgumentException::class);
0 commit comments