You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADE-4.1.md
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,27 @@
1
1
UPGRADE FROM 4.0 to 4.1
2
2
=======================
3
3
4
+
Console
5
+
-------
6
+
7
+
* The `Application::findNamespace` method throws an instance of `NamespaceNotFoundException` instead `CommandNotFoundException`. All catch statements should be updated to cater for both exceptions, E.G
Copy file name to clipboardExpand all lines: UPGRADE-5.0.md
+21Lines changed: 21 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,27 @@
1
1
UPGRADE FROM 4.x to 5.0
2
2
=======================
3
3
4
+
Console
5
+
-------
6
+
7
+
* The `NamespaceNotFoundException` doesn't extend `CommandNotFoundException` anymore. All catch statements should be updated to cater for both exceptions, E.G
thrownewCommandNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
568
+
thrownewNamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces));
$this->assertSame("Command \"foos\" is not defined.\nDo you want to run \"foo\" instead? [y/n] ", $tester->getDisplay(true));
483
+
}
484
+
460
485
publicfunctionprovideInvalidCommandNamesSingle()
461
486
{
462
487
returnarray(
@@ -486,10 +511,10 @@ public function testFindAlternativeExceptionMessageMultiple()
486
511
// Namespace + plural
487
512
try {
488
513
$application->find('foo2:bar');
489
-
$this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives');
514
+
$this->fail('->find() throws a NamespaceNotFoundException if command does not exist, with alternatives');
490
515
} catch (\Exception$e) {
491
-
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
492
-
$this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
516
+
$this->assertInstanceOf('Symfony\Component\Console\Exception\NamespaceNotFoundException', $e, '->find() throws a NamespaceNotFoundException if command does not exist, with alternatives');
517
+
$this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a NamespaceNotFoundException if command does not exist, with alternatives');
493
518
$this->assertRegExp('/foo1/', $e->getMessage());
494
519
}
495
520
@@ -563,26 +588,26 @@ public function testFindAlternativeNamespace()
$this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
591
+
$this->fail('->find() throws a NamespaceNotFoundException if namespace does not exist');
567
592
} catch (\Exception$e) {
568
-
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist');
593
+
$this->assertInstanceOf('Symfony\Component\Console\Exception\NamespaceNotFoundException', $e, '->find() throws a NamespaceNotFoundException if namespace does not exist');
$this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, without alternatives');
595
+
$this->assertEquals('There are no commands defined in the "Unknown-namespace" namespace.', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, without alternatives');
571
596
}
572
597
573
598
try {
574
599
$application->find('foo2:command');
575
-
$this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
600
+
$this->fail('->find() throws a NamespaceNotFoundException if namespace does not exist');
576
601
} catch (\Exception$e) {
577
-
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist');
602
+
$this->assertInstanceOf('Symfony\Component\Console\Exception\NamespaceNotFoundException', $e, '->find() throws a NamespaceNotFoundException if namespace does not exist');
$this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative');
583
-
$this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"');
584
-
$this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"');
585
-
$this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"');
607
+
$this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, with alternative');
608
+
$this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, with alternative : "foo"');
609
+
$this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, with alternative : "foo1"');
610
+
$this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, with alternative : "foo3"');
0 commit comments