From a6823d2f9b62d4e2244eee6d12da1ef0fc44502b Mon Sep 17 00:00:00 2001 From: Fabian Grutschus Date: Wed, 16 Oct 2013 10:07:10 +0200 Subject: [PATCH] non-deep check returns allways false --- src/Composer/Repository/Vcs/PerforceDriver.php | 4 ++++ .../Test/Repository/Vcs/PerforceDriverTest.php | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/Composer/Repository/Vcs/PerforceDriver.php b/src/Composer/Repository/Vcs/PerforceDriver.php index a6d52bfb6..af20c4667 100644 --- a/src/Composer/Repository/Vcs/PerforceDriver.php +++ b/src/Composer/Repository/Vcs/PerforceDriver.php @@ -160,6 +160,10 @@ class PerforceDriver extends VcsDriver */ public static function supports(IOInterface $io, $url, $deep = false) { + if (false === $deep) { + return false; + } + return Perforce::checkServerExists($url, new ProcessExecutor); } diff --git a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php index 277550e64..d2c8167b9 100644 --- a/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php +++ b/tests/Composer/Test/Repository/Vcs/PerforceDriverTest.php @@ -131,4 +131,17 @@ class PerforceDriverTest extends \PHPUnit_Framework_TestCase $result = $driver->hasComposerFile($identifier); $this->assertTrue($result); } + + /** + * Test that supports() simply return false. + * + * @covers \Composer\Repository\Vcs\PerforceDriver::supports + * + * @return void + */ + public function testSupportsReturnsFalseNoDeepCheck() + { + $this->expectOutputString(''); + $this->assertFalse(PerforceDriver::supports($this->io, 'existing.url')); + } }