Esempio n. 1
0
 public function testGetComposerInformationWithLabelWithStream()
 {
     $this->setPerforceToStream();
     $expectedCommand = 'p4 -u user -p port  files //depot/branch/composer.json@0.0.1';
     $this->processExecutor->expects($this->at(0))->method('execute')->with($this->equalTo($expectedCommand))->will($this->returnCallback(function ($command, &$output) {
         $output = '//depot/composer.json#1 - branch change 10001 (text)';
         return true;
     }));
     $expectedCommand = 'p4 -u user -c composer_perforce_TEST_depot_branch -p port  print //depot/branch/composer.json@10001';
     $this->processExecutor->expects($this->at(1))->method('execute')->with($this->equalTo($expectedCommand))->will($this->returnCallback(function ($command, &$output) {
         $output = PerforceTest::getComposerJson();
         return true;
     }));
     $result = $this->perforce->getComposerInformation('//depot/branch@0.0.1');
     $expected = array('name' => 'test/perforce', 'description' => 'Basic project for testing', 'minimum-stability' => 'dev', 'autoload' => array('psr-0' => array()));
     $this->assertEquals($expected, $result);
 }
Esempio n. 2
0
 public function getTestRepoConfig()
 {
     return array_merge(parent::getTestRepoConfig(), array('filename' => 'ASSET.json'));
 }