Example #1
0
 /**
  * @covers Pants\Project::execute
  */
 public function testBaseDirChangesTheCurrentWorkingDirectory()
 {
     $task = $this->getMock('\\Pants\\Task\\Task');
     $task->expects($this->once())->method('execute')->will($this->returnSelf());
     $this->project->getTasks()->expects($this->once())->method('getIterator')->will($this->returnValue(new ArrayIterator(array($task))));
     $cwd = getcwd();
     $this->project->setBaseDirectory('/')->execute();
     $this->assertEquals('/', getcwd());
     chdir($cwd);
 }