public function CommandTest::testSetGetDefinition in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/console/Tests/Command/CommandTest.php \Symfony\Component\Console\Tests\Command\CommandTest::testSetGetDefinition()
File
- vendor/
symfony/ console/ Tests/ Command/ CommandTest.php, line 59
Class
Namespace
Symfony\Component\Console\Tests\CommandCode
public function testSetGetDefinition() {
$command = new \TestCommand();
$ret = $command
->setDefinition($definition = new InputDefinition());
$this
->assertEquals($command, $ret, '->setDefinition() implements a fluent interface');
$this
->assertEquals($definition, $command
->getDefinition(), '->setDefinition() sets the current InputDefinition instance');
$command
->setDefinition(array(
new InputArgument('foo'),
new InputOption('bar'),
));
$this
->assertTrue($command
->getDefinition()
->hasArgument('foo'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument');
$this
->assertTrue($command
->getDefinition()
->hasOption('bar'), '->setDefinition() also takes an array of InputArguments and InputOptions as an argument');
$command
->setDefinition(new InputDefinition());
}