示例#1
0
 /**
  * @covers Pants\Task\Chdir::__construct
  * @covers Pants\Task\Chdir::execute
  */
 public function testChdirChangesTheCurrentWorkingDirectory()
 {
     $directory = __DIR__ . '/_files';
     $this->properties->expects($this->once())->method('filter')->with($directory)->will($this->returnArgument(0));
     $this->task->setDirectory($directory)->execute();
     $this->assertEquals(realPath(__DIR__ . '/_files'), getcwd());
 }
示例#2
0
 /**
  * @covers Pants\Task\Chown::__construct
  * @covers Pants\Task\Chown::execute
  */
 public function testOwnerIsSet()
 {
     $this->properties->expects($this->at(0))->method('filter')->with(1000)->will($this->returnArgument(0));
     $this->properties->expects($this->at(1))->method('filter')->with($this->file)->will($this->returnArgument(0));
     $this->chown->setFile($this->file)->setOwner(1000)->execute();
     $this->assertEquals(1000, fileowner($this->file));
 }