66use Inhere \Console \Console ;
77use Inhere \Console \IO \Input ;
88use Inhere \Console \IO \InputInterface ;
9+ use Inhere \Console \Router ;
910use PHPUnit \Framework \TestCase ;
1011
1112class ApplicationTest extends TestCase
1213{
13- private function newApp (array $ args = null )
14+ private function newApp (array $ args = null ): Application
1415 {
1516 $ input = new Input ($ args );
1617
@@ -21,7 +22,7 @@ private function newApp(array $args = null)
2122 ], $ input );
2223 }
2324
24- public function testApp ()
25+ public function testApp (): void
2526 {
2627 $ app = Console::newApp ([
2728 'name ' => 'Tests ' ,
@@ -34,7 +35,7 @@ public function testApp()
3435 $ this ->assertInstanceOf (InputInterface::class, $ app ->getInput ());
3536 }
3637
37- public function testAddCommand ()
38+ public function testAddCommand (): void
3839 {
3940 $ app = $ this ->newApp ();
4041
@@ -50,7 +51,7 @@ public function testAddCommand()
5051 $ this ->assertContains ('test ' , $ router ->getCommandNames ());
5152 }
5253
53- public function testAddCommandError ()
54+ public function testAddCommandError (): void
5455 {
5556 $ app = $ this ->newApp ();
5657
@@ -63,7 +64,7 @@ public function testAddCommandError()
6364 $ app ->addCommand ('test ' , 'invalid ' );
6465 }
6566
66- public function testRunCommand ()
67+ public function testRunCommand (): void
6768 {
6869 $ app = $ this ->newApp ([
6970 './app ' ,
@@ -78,7 +79,7 @@ public function testRunCommand()
7879 $ this ->assertSame ('hello ' , $ ret );
7980 }
8081
81- public function testAddController ()
82+ public function testAddController (): void
8283 {
8384 $ app = $ this ->newApp ();
8485
@@ -89,11 +90,13 @@ public function testAddController()
8990 $ this ->assertTrue ($ app ->getRouter ()->isController ('test ' ));
9091 $ this ->assertFalse ($ app ->getRouter ()->isCommand ('test ' ));
9192 $ this ->assertArrayHasKey ('test ' , $ router ->getControllers ());
92- $ this ->assertContains ('test ' , $ router ->getControllerNames ());
93- $ this ->assertSame (TestController::class, $ router ->getControllers ()['test ' ]);
93+
94+ $ group = $ router ->getControllers ()['test ' ];
95+ $ this ->assertSame (TestController::class, $ group ['handler ' ]);
96+ $ this ->assertSame (Router::TYPE_GROUP , $ group ['type ' ]);
9497 }
9598
96- public function testAddControllerError ()
99+ public function testAddControllerError (): void
97100 {
98101 $ app = $ this ->newApp ();
99102
@@ -106,7 +109,7 @@ public function testAddControllerError()
106109 $ app ->controller ('test ' , 'invalid ' );
107110 }
108111
109- public function testRunController ()
112+ public function testRunController (): void
110113 {
111114 $ app = $ this ->newApp ([
112115 './app ' ,
0 commit comments