From 492539101cf660f394545bbde32152c29ec1d965 Mon Sep 17 00:00:00 2001 From: Clark Stuth Date: Tue, 18 Mar 2014 13:52:54 -0500 Subject: [PATCH] got all unit tests passing --- src/Composer/Repository/Vcs/PerforceDriver.php | 2 ++ src/Composer/Util/Perforce.php | 2 +- tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Composer/Repository/Vcs/PerforceDriver.php b/src/Composer/Repository/Vcs/PerforceDriver.php index 6a55033a1..535a79516 100644 --- a/src/Composer/Repository/Vcs/PerforceDriver.php +++ b/src/Composer/Repository/Vcs/PerforceDriver.php @@ -141,6 +141,8 @@ class PerforceDriver extends VcsDriver $this->composerInfo = $this->perforce->getComposerInformation('//' . $this->depot . '/' . $identifier); $this->composerInfoIdentifier = $identifier; $result = false; + return !empty($this->composerInfo); + if (!empty($this->composerInfo)) { $result = count($this->composerInfo) > 0; } diff --git a/src/Composer/Util/Perforce.php b/src/Composer/Util/Perforce.php index 2a1094e59..ecafaf6f0 100644 --- a/src/Composer/Util/Perforce.php +++ b/src/Composer/Util/Perforce.php @@ -47,7 +47,7 @@ class Perforce $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)) { $process = new ProcessExecutor; diff --git a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php index bc228de7e..7666efebc 100644 --- a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php @@ -126,7 +126,7 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase $identifier = 'TEST_IDENTIFIER'; $formatted_depot_path = '//' . self::TEST_DEPOT . '/' . $identifier; $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(); $result = $this->driver->hasComposerFile($identifier); $this->assertFalse($result); @@ -141,7 +141,7 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase $identifier = 'TEST_IDENTIFIER'; $formatted_depot_path = '//' . self::TEST_DEPOT . '/' . $identifier; $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(); $result = $this->driver->hasComposerFile($identifier); $this->assertTrue($result);