You are here

public function ApplicationTest::testFind in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/ApplicationTest.php \Symfony\Component\Console\Tests\ApplicationTest::testFind()

File

vendor/symfony/console/Tests/ApplicationTest.php, line 251

Class

ApplicationTest

Namespace

Symfony\Component\Console\Tests

Code

public function testFind() {
  $application = new Application();
  $application
    ->add(new \FooCommand());
  $this
    ->assertInstanceOf('FooCommand', $application
    ->find('foo:bar'), '->find() returns a command if its name exists');
  $this
    ->assertInstanceOf('Symfony\\Component\\Console\\Command\\HelpCommand', $application
    ->find('h'), '->find() returns a command if its name exists');
  $this
    ->assertInstanceOf('FooCommand', $application
    ->find('f:bar'), '->find() returns a command if the abbreviation for the namespace exists');
  $this
    ->assertInstanceOf('FooCommand', $application
    ->find('f:b'), '->find() returns a command if the abbreviation for the namespace and the command name exist');
  $this
    ->assertInstanceOf('FooCommand', $application
    ->find('a'), '->find() returns a command if the abbreviation exists for an alias');
}