public function testHasGet() { $application = new Application(); $this->assertTrue($application->has('list'), '->has() returns true if a named command is registered'); $this->assertFalse($application->has('afoobar'), '->has() returns false if a named command is not registered'); $application->add($foo = new \FooCommand()); $this->assertTrue($application->has('afoobar'), '->has() returns true if an alias is registered'); $this->assertEquals($foo, $application->get('foo:bar'), '->get() returns a command by name'); $this->assertEquals($foo, $application->get('afoobar'), '->get() returns a command by alias'); $application = new Application(); $application->add($foo = new \FooCommand()); // simulate --help $r = new \ReflectionObject($application); $p = $r->getProperty('wantHelps'); $p->setAccessible(true); $p->setValue($application, true); $command = $application->get('foo:bar'); $this->assertInstanceOf('Danack\\Console\\Command\\HelpCommand', $command, '->get() returns the help command if --help is provided as the input'); }