示例#1
0
 /**
  * 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);
 }
示例#2
0
 /**
  * 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);
 }