got all unit tests passing

main
Clark Stuth 10 years ago
parent 24dd42267f
commit 492539101c

@ -141,6 +141,8 @@ class PerforceDriver extends VcsDriver
$this->composerInfo = $this->perforce->getComposerInformation('//' . $this->depot . '/' . $identifier); $this->composerInfo = $this->perforce->getComposerInformation('//' . $this->depot . '/' . $identifier);
$this->composerInfoIdentifier = $identifier; $this->composerInfoIdentifier = $identifier;
$result = false; $result = false;
return !empty($this->composerInfo);
if (!empty($this->composerInfo)) { if (!empty($this->composerInfo)) {
$result = count($this->composerInfo) > 0; $result = count($this->composerInfo) > 0;
} }

@ -47,7 +47,7 @@ class Perforce
$this->io = $io; $this->io = $io;
} }
public static function create($repoConfig, $port, $path, ProcessExecutor $process = null, IOInterface $io) public static function create($repoConfig, $port, $path, ProcessExecutor $process, IOInterface $io)
{ {
if (!isset($process)) { if (!isset($process)) {
$process = new ProcessExecutor; $process = new ProcessExecutor;

@ -126,7 +126,7 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase
$identifier = 'TEST_IDENTIFIER'; $identifier = 'TEST_IDENTIFIER';
$formatted_depot_path = '//' . self::TEST_DEPOT . '/' . $identifier; $formatted_depot_path = '//' . self::TEST_DEPOT . '/' . $identifier;
$this->driver->setPerforce($this->perforce); $this->driver->setPerforce($this->perforce);
$this->perforce->expects($this->at(0))->method('getComposerInformation')->with($this->equalTo($formatted_depot_path))->will($this->returnValue(array())); $this->perforce->expects($this->any())->method('getComposerInformation')->with($this->equalTo($formatted_depot_path))->will($this->returnValue(array()));
$this->driver->initialize(); $this->driver->initialize();
$result = $this->driver->hasComposerFile($identifier); $result = $this->driver->hasComposerFile($identifier);
$this->assertFalse($result); $this->assertFalse($result);
@ -141,7 +141,7 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase
$identifier = 'TEST_IDENTIFIER'; $identifier = 'TEST_IDENTIFIER';
$formatted_depot_path = '//' . self::TEST_DEPOT . '/' . $identifier; $formatted_depot_path = '//' . self::TEST_DEPOT . '/' . $identifier;
$this->driver->setPerforce($this->perforce); $this->driver->setPerforce($this->perforce);
$this->perforce->expects($this->at(0))->method('getComposerInformation')->with($this->equalTo($formatted_depot_path))->will($this->returnValue(array(''))); $this->perforce->expects($this->any())->method('getComposerInformation')->with($this->equalTo($formatted_depot_path))->will($this->returnValue(array('')));
$this->driver->initialize(); $this->driver->initialize();
$result = $this->driver->hasComposerFile($identifier); $result = $this->driver->hasComposerFile($identifier);
$this->assertTrue($result); $this->assertTrue($result);

Loading…
Cancel
Save