示例#1
0
 public function testAddCommand()
 {
     $application = new Application();
     $application->addCommand($foo = new \FooCommand());
     $commands = $application->getCommands();
     $this->assertEquals($foo, $commands['foo:bar'], '->addCommand() registers a command');
     $application = new Application();
     $application->addCommands(array($foo = new \FooCommand(), $foo1 = new \Foo1Command()));
     $commands = $application->getCommands();
     $this->assertEquals(array($foo, $foo1), array($commands['foo:bar'], $commands['foo:bar1']), '->addCommands() registers an array of commands');
 }