/** * @covers Pants\Target\Target::__construct * @covers Pants\Target\Target::execute */ public function testDependIsExecuted() { $target = $this->getMockBuilder('\\Pants\\Target\\Target')->disableOriginalConstructor()->getMock(); $target->expects($this->once())->method('execute')->will($this->returnSelf()); $this->targets->expects($this->once())->method('__get')->with('test')->will($this->returnValue($target)); $this->tasks->expects($this->once())->method('getIterator')->will($this->returnValue(new ArrayIterator())); $this->target->setDepends(array('test'))->execute(); }
/** * @covers Pants\Task\Tasks::add * @covers Pants\Task\Tasks::getIterator */ public function testTasksCanBeAdded() { $task = $this->getMock('Pants\\Task\\Task'); $this->tasks->add($task); $this->assertEquals(array($task), iterator_to_array($this->tasks)); }