/** * Test the command will return to base by adding a child to it. */ public function testCommandWillReturnToBaseConstraint() { $this->setExpectedException('\\Chainnn\\Exception\\LogicException'); $parentCommand = new Command('parentMethod', array('returnToBase' => true)); $childCommand = new Command('childMethod'); $parentCommand->addChild($childCommand); }
/** * Returns if a command is a child. * * @param \Chainnn\Command $command * @return boolean */ public function hasChild(Command $command) { return array_key_exists($command->getMethodName(), $this->children); }