Пример #1
0
 function testExecute()
 {
     $Repo = new TestRepo($this->__repos[1]);
     $result = $Repo->execute('ls', array(TMP), true);
     $expected = "ls " . TMP;
     $this->assertEqual($result, $expected);
     $result = $Repo->run('ls', array('--git-dir', TMP), true);
     $expected = "git ls --git-dir " . TMP;
     $this->assertEqual($result, $expected);
     $Repo->before("cd {$Repo->path}");
     $result = $Repo->run('ls', array('--git-dir', TMP), true);
     $expected = "cd " . $this->__repos[1]['path'] . " && git ls --git-dir " . TMP;
     $this->assertEqual($result, $expected);
 }
Пример #2
0
 /**
  * @test
  */
 public function constructor()
 {
     $mockModel = m::mock('Model');
     $mockService = new TestRepo($mockModel);
     $this->assertEquals($mockModel, $mockService->getModel());
 }