public function testBranchExists() { $commandExecutor = new MockCommandExecutor(new MockCommandBuilder()); $vcs = new SvnVcs($commandExecutor, new RepositoryConfig()); $meta = $vcs->getMeta(); $this->assertInstanceOf('\\ptlis\\Vcs\\Interfaces\\MetaInterface', $meta); }
public function testNotFound() { $this->setExpectedException('\\RuntimeException', 'Revision "400" not found.'); $results = array(new ShellResult(0, '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL . '<log>' . PHP_EOL . 'svn: E195012: Unable to find repository location for ' . '\'http://example.com/repos/myproject/trunk\' in revision 400' . PHP_EOL, '')); $commandExecutor = new MockCommandExecutor(new MockCommandBuilder($results, '/usr/bin/svn')); $vcs = new SvnVcs($commandExecutor, new RepositoryConfig()); $vcs->checkoutRevision('400'); }
public function testBranchDoesntExist() { $this->setExpectedException('\\RuntimeException', 'Branch named "feat-new-badness" not found.'); $results = array(new ShellResult(1, '' . PHP_EOL, 'svn: warning: W155010: The node \'/path/to/repo/branches/feat-new-badness\' was not found.' . PHP_EOL . 'svn: E200009: Could not list all targets because some targets don\'t exist')); $commandExecutor = new MockCommandExecutor(new MockCommandBuilder($results, '/usr/bin/svn')); $vcs = new SvnVcs($commandExecutor, new RepositoryConfig()); $vcs->changeBranch('feat-new-badness'); }
public function testBranchExists() { $results = array(new ShellResult(0, '', '')); $commandExecutor = new MockCommandExecutor(new MockCommandBuilder($results, '/usr/bin/svn')); $vcs = new SvnVcs($commandExecutor, new RepositoryConfig()); $vcs->update(); $this->assertEquals(array(), $commandExecutor->getArguments()); }