public function testPublicRepositoryWithFilesystemCache()
 {
     $identifier = 'TEST_IDENTIFIER';
     $this->perforce->expects($this->any())->method('getComposerInformation')->with($this->equalTo($identifier))->will($this->returnValue(array('name' => 'foo')));
     $driver2 = new PerforceDriver($this->repoConfig, $this->io, $this->config, $this->process, $this->remoteFileSystem);
     $reflectionClass = new \ReflectionClass($driver2);
     $property = $reflectionClass->getProperty('perforce');
     $property->setAccessible(true);
     $property->setValue($driver2, $this->perforce);
     $this->driver->initialize();
     $driver2->initialize();
     $composer1 = $this->driver->getComposerInformation($identifier);
     $composer2 = $driver2->getComposerInformation($identifier);
     $this->assertNotNull($composer1);
     $this->assertNotNull($composer2);
     $this->assertSame($composer1, $composer2);
 }
Exemple #2
0
 private function setAssetPerforceToStream()
 {
     $this->perforce->setStream('//depot/branch');
 }
 /**
  * @param array $repoConfig
  */
 private function initAssetPerforce($repoConfig)
 {
     if (!empty($this->perforce)) {
         return;
     }
     $repoDir = $this->config->get('cache-vcs-dir') . '/' . $this->depot;
     $this->perforce = Perforce::create($repoConfig, $this->getUrl(), $repoDir, $this->process, $this->io);
 }