public function testGetRevisionLog()
 {
     $repository_connector = $this->prophesize('ConsoleHelpers\\SVNBuddy\\Repository\\Connector\\Connector');
     $repository_connector->withCache('1 year')->willReturn($repository_connector)->shouldBeCalled();
     $repository_connector->getProperty('bugtraq:logregex', 'svn://localhost/trunk')->willReturn('')->shouldBeCalled();
     $repository_connector->getFirstRevision('svn://localhost')->willReturn(1)->shouldBeCalled();
     $repository_connector->getLastRevision('svn://localhost')->willReturn(1)->shouldBeCalled();
     $repository_connector->getProjectUrl('svn://localhost/trunk')->willReturn('svn://localhost')->shouldBeCalled();
     $cache_manager = $this->prophesize('ConsoleHelpers\\SVNBuddy\\Cache\\CacheManager');
     $cache_manager->getCache('log:svn://localhost', Argument::containingString('main:'))->shouldBeCalled();
     $io = $this->prophesize('ConsoleHelpers\\ConsoleKit\\ConsoleIO');
     $factory = new RevisionLogFactory($repository_connector->reveal(), $cache_manager->reveal(), $io->reveal());
     $revision_log = $factory->getRevisionLog('svn://localhost/trunk');
     $this->assertInstanceOf('ConsoleHelpers\\SVNBuddy\\Repository\\RevisionLog\\RevisionLog', $revision_log);
 }
示例#2
0
 /**
  * Returns revision log.
  *
  * @param string $repository_url Repository url.
  *
  * @return RevisionLog
  */
 protected function getRevisionLog($repository_url)
 {
     if (!isset($this->_revisionLogs[$repository_url])) {
         $this->_revisionLogs[$repository_url] = $this->_revisionLogFactory->getRevisionLog($repository_url);
     }
     return $this->_revisionLogs[$repository_url];
 }
 public function testGetRevisionLog()
 {
     $repository_connector = $this->prophesize('ConsoleHelpers\\SVNBuddy\\Repository\\Connector\\Connector');
     $repository_connector->removeCredentials('svn://localhost/projects/project-name/trunk')->willReturnArgument(0)->shouldBeCalled();
     $repository_connector->getLastRevision('svn://localhost')->willReturn(0)->shouldBeCalled();
     $repository_connector->getRootUrl('svn://localhost/projects/project-name/trunk')->willReturn('svn://localhost')->shouldBeCalled();
     $repository_connector->getRelativePath('svn://localhost/projects/project-name/trunk')->willReturn('/projects/project-name/trunk')->shouldBeCalled();
     $repository_connector->getProjectUrl('/projects/project-name/trunk')->willReturn('/projects/project-name')->shouldBeCalled();
     $repository_connector->getRefByPath('/projects/project-name/trunk')->willReturn('trunk')->shouldBeCalled();
     $database_manager = $this->prophesize('ConsoleHelpers\\SVNBuddy\\Repository\\RevisionLog\\DatabaseManager');
     $database_manager->getDatabase('svn://localhost', null)->willReturn($this->database);
     $database_manager->runMigrations(Argument::type('ConsoleHelpers\\SVNBuddy\\Repository\\RevisionLog\\MigrationContext'))->shouldBeCalled();
     $log_message_parser_factory = $this->prophesize('ConsoleHelpers\\SVNBuddy\\Repository\\Parser\\LogMessageParserFactory');
     $factory = new RevisionLogFactory($repository_connector->reveal(), $database_manager->reveal(), $log_message_parser_factory->reveal());
     $this->assertInstanceOf('ConsoleHelpers\\SVNBuddy\\Repository\\RevisionLog\\RevisionLog', $factory->getRevisionLog('svn://localhost/projects/project-name/trunk'));
 }
 /**
  * Returns revision log.
  *
  * @param string $repository_url Repository url.
  *
  * @return RevisionLog
  */
 protected function getRevisionLog($repository_url)
 {
     return $this->_revisionLogFactory->getRevisionLog($repository_url, $this->io);
 }