public function testExecuteWithInvalidWorkingDirectorySetThrowsException() { $process = new Process(); $workingDirectory = '/fake/' . __DIR__; $process->setCommand("php -r \"echo getcwd();\""); $process->setWorkingDirectory($workingDirectory); $this->setExpectedException('\\PhpProc\\Exception\\RuntimeException'); $process->execute(); }
/** * Pulls changes from the default remote of an existing local repository. * * @param string $path Path to the local repository * * @return Repository * * @throws Exception\RuntimeException * @throws Exception\RepositoryNotFoundException */ public function invokePull($path) { if (false === $this->repoExists($path)) { throw new RepoNotFoundException("No Git repository was found at '{$path}'"); } $result = $this->process->setWorkingDirectory($path)->setCommand("{$this->path} pull")->execute(); if ($result->hasErrors()) { throw new RuntimeException("Failed to pull at {$path}: {$result->getStdErrContents()}"); } }