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