@@ -89,7 +89,7 @@ public function testAddCommandError(): void
8989 }
9090 }
9191
92- public function testRunCommand_class (): void
92+ public function testAddCommand_class_run (): void
9393 {
9494 $ app = $ this ->newApp ([
9595 './app ' ,
@@ -101,7 +101,7 @@ public function testRunCommand_class(): void
101101 self ::assertSame ('Inhere\ConsoleTest\TestCommand::execute ' , $ ret );
102102 }
103103
104- public function testRunCommand_callback (): void
104+ public function testAddCommand_callback_run (): void
105105 {
106106 $ app = $ this ->newApp ([
107107 './app ' ,
@@ -116,14 +116,14 @@ public function testRunCommand_callback(): void
116116 self ::assertSame ('hello ' , $ ret );
117117 }
118118
119- public function testRun_Command_object (): void
119+ public function testAddCommand_object_run (): void
120120 {
121121 $ app = $ this ->newApp ([
122122 './app ' ,
123123 'test '
124124 ]);
125125
126- $ app ->addCommand ('test ' , new TestCommand ());
126+ $ app ->command ('test ' , new TestCommand ());
127127
128128 $ ret = $ app ->run (false );
129129 self ::assertSame ('Inhere\ConsoleTest\TestCommand::execute ' , $ ret );
@@ -165,7 +165,7 @@ public function testAddControllerError(): void
165165 }
166166 }
167167
168- public function testRunController (): void
168+ public function testAdd_Controller_class_Run (): void
169169 {
170170 $ app = $ this ->newApp ([
171171 './app ' ,
@@ -178,6 +178,19 @@ public function testRunController(): void
178178 self ::assertSame ('Inhere\ConsoleTest\TestController::demoCommand ' , $ ret );
179179 }
180180
181+ public function testAdd_Controller_object_Run (): void
182+ {
183+ $ app = $ this ->newApp ([
184+ './app ' ,
185+ 'test:demo '
186+ ]);
187+
188+ $ app ->controller ('test ' , new TestController );
189+
190+ $ ret = $ app ->run (false );
191+ self ::assertSame ('Inhere\ConsoleTest\TestController::demoCommand ' , $ ret );
192+ }
193+
181194 public function testTriggerEvent (): void
182195 {
183196 $ app = $ this ->newApp ([
0 commit comments