@@ -123,7 +123,7 @@ public function testBundleCommandCanOverriddeAPreExistingCommandWithTheSameName(
123
123
$ this ->assertSame ($ newCommand , $ application ->get ('example ' ));
124
124
}
125
125
126
- public function testRunOnlyWarnsOnUnregistrableCommand ()
126
+ public function testUnregistrableCommandsAreConsideredFailure ()
127
127
{
128
128
$ container = new ContainerBuilder ();
129
129
$ container ->register ('event_dispatcher ' , EventDispatcher::class);
@@ -147,7 +147,7 @@ public function testRunOnlyWarnsOnUnregistrableCommand()
147
147
$ tester ->run (['command ' => 'fine ' ]);
148
148
$ output = $ tester ->getDisplay ();
149
149
150
- $ tester ->assertCommandIsSuccessful ( );
150
+ $ this -> assertSame ( 1 , $ tester ->getStatusCode () );
151
151
$ this ->assertStringContainsString ('Some commands could not be registered: ' , $ output );
152
152
$ this ->assertStringContainsString ('throwing ' , $ output );
153
153
$ this ->assertStringContainsString ('fine ' , $ output );
@@ -180,7 +180,7 @@ public function testRegistrationErrorsAreDisplayedOnCommandNotFound()
180
180
$ this ->assertStringContainsString ('Command "fine" is not defined. ' , $ output );
181
181
}
182
182
183
- public function testRunOnlyWarnsOnUnregistrableCommandAtTheEnd ()
183
+ public function testRunFailsOnUnregistrableCommandAtTheEnd ()
184
184
{
185
185
$ container = new ContainerBuilder ();
186
186
$ container ->register ('event_dispatcher ' , EventDispatcher::class);
@@ -204,7 +204,7 @@ public function testRunOnlyWarnsOnUnregistrableCommandAtTheEnd()
204
204
$ tester = new ApplicationTester ($ application );
205
205
$ tester ->run (['command ' => 'list ' ]);
206
206
207
- $ tester ->assertCommandIsSuccessful ( );
207
+ $ this -> assertSame ( 1 , $ tester ->getStatusCode () );
208
208
$ display = explode ('List commands ' , $ tester ->getDisplay ());
209
209
210
210
$ this ->assertStringContainsString (trim ('[WARNING] Some commands could not be registered: ' ), trim ($ display [1 ]));
0 commit comments