$command->
setApplication(null
);
$this->
assertNull($command->
getHelperSet());
} 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([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());
} public function testAddArgument() { $command =
new \
TestCommand();
$ret =
$command->
addArgument('foo'
);
$this->
assertEquals($command,
$ret, '->addArgument() implements a fluent interface'
);
$this->
assertTrue($command->
getDefinition()->
hasArgument('foo'
), '->addArgument() adds an argument to the command'
);
}