10000 Revert some changes to tests · symfony/symfony@bf46ffe · GitHub
[go: up one dir, main page]

Skip to content

Commit bf46ffe

Browse files
committed
Revert some changes to tests
1 parent f8a816d commit bf46ffe

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/Symfony/Component/Console/Tests/ApplicationTest.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -550,10 +550,10 @@ public function testFindAlternativeExceptionMessageMultiple()
550550
// Namespace + plural
551551
try {
552552
$application->find('foo2:bar');
553-
$this->fail('->find() throws a NamespaceNotFoundException if command does not exist, with alternatives');
553+
$this->fail('->find() throws a CommandNotFoundException if command does not exist, with alternatives');
554554
} catch (\Exception $e) {
555-
$this->assertInstanceOf('Symfony\Component\Console\Exception\NamespaceNotFoundException', $e, '->find() throws a NamespaceNotFoundException if command does not exist, with alternatives');
556-
$this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a NamespaceNotFoundException if command does not exist, with alternatives');
555+
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
556+
$this->assertRegExp('/Did you mean one of these/', $e->getMessage(), '->find() throws a CommandNotFoundException if command does not exist, with alternatives');
557557
$this->assertRegExp('/foo1/', $e->getMessage());
558558
}
559559

@@ -627,26 +627,27 @@ public function testFindAlternativeNamespace()
627627

628628
try {
629629
$application->find('Unknown-namespace:Unknown-command');
630-
$this->fail('->find() throws a NamespaceNotFoundException if namespace does not exist');
630+
$this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
631631
} catch (\Exception $e) {
632-
$this->assertInstanceOf('Symfony\Component\Console\Exception\NamespaceNotFoundException', $e, '->find() throws a NamespaceNotFoundException if namespace does not exist');
632+
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, '->find() throws a CommandNotFoundException if namespace does not exist');
633633
$this->assertSame(array(), $e->getAlternatives());
634-
$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');
634+
$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');
635635
}
636636

637637
try {
638638
$application->find('foo2:command');
639-
$this->fail('->find() throws a NamespaceNotFoundException if namespace does not exist');
639+
$this->fail('->find() throws a CommandNotFoundException if namespace does not exist');
640640
} catch (\Exception $e) {
641641
$this->assertInstanceOf('Symfony\Component\Console\Exception\NamespaceNotFoundException', $e, '->find() throws a NamespaceNotFoundException if namespace does not exist');
642+
$this->assertInstanceOf('Symfony\Component\Console\Exception\CommandNotFoundException', $e, 'NamespaceNotFoundException extends from CommandNotFoundException');
642643
$this->assertCount(3, $e->getAlternatives());
643644
$this->assertContains('foo', $e->getAlternatives());
644645
$this->assertContains('foo1', $e->getAlternatives());
645646
$this->assertContains('foo3', $e->getAlternatives());
646-
$this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, with alternative');
647-
$this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, with alternative : "foo"');
648-
$this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, with alternative : "foo1"');
649-
$this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a NamespaceNotFoundException if namespace does not exist, with alternative : "foo3"');
647+
$this->assertRegExp('/There are no commands defined in the "foo2" namespace./', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative');
648+
$this->assertRegExp('/foo/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo"');
649+
$this->assertRegExp('/foo1/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo1"');
650+
$this->assertRegExp('/foo3/', $e->getMessage(), '->find() throws a CommandNotFoundException if namespace does not exist, with alternative : "foo3"');
650651
}
651652
}
652653

0 commit comments

Comments
 (0)
0