$this->
assertEquals($foo,
$application->
get('afoobar'
), '->get() returns an instance by alias even with command loader'
);
$this->
assertTrue($application->
has('foo:bar1'
), '->has() returns true for commands registered in the loader'
);
$this->
assertInstanceOf(\Foo1Command::
class,
$foo1 =
$application->
get('foo:bar1'
), '->get() returns a command by name from the command loader'
);
$this->
assertTrue($application->
has('afoobar1'
), '->has() returns true for commands registered in the loader'
);
$this->
assertEquals($foo1,
$application->
get('afoobar1'
), '->get() returns a command by name from the command loader'
);
} public function testSilentHelp() { $application =
new Application();
$application->
setAutoExit(false
);
$application->
setCatchExceptions(false
);
$tester =
new ApplicationTester($application);
$tester->
run(['-h' => true, '-q' => true
],
['decorated' => false
]);
$this->
assertEmpty($tester->
getDisplay(true
));
} public function testGetInvalidCommand() { $this->
expectException(CommandNotFoundException::
class);
$this->
expectExceptionMessage('The command "foofoo" does not exist.'
);