1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00
This commit is contained in:
Jordi Boggiano 2022-08-17 15:20:07 +03:00 committed by GitHub
parent 6e205a0c84
commit 131da999ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
357 changed files with 5943 additions and 9174 deletions

View file

@ -65,11 +65,11 @@ class PerforceDriverTest extends TestCase
{
$this->testPath = self::getUniqueTmpDirectory();
$this->config = $this->getTestConfig($this->testPath);
$this->repoConfig = array(
$this->repoConfig = [
'url' => self::TEST_URL,
'depot' => self::TEST_DEPOT,
'branch' => self::TEST_BRANCH,
);
];
$this->io = $this->getMockIOInterface();
$this->process = $this->getProcessExecutorMock();
$this->httpDownloader = $this->getMockHttpDownloader();
@ -86,9 +86,6 @@ class PerforceDriverTest extends TestCase
$fs->removeDirectory($this->testPath);
}
/**
* @return void
*/
protected function overrideDriverInternalPerforce(Perforce $perforce): void
{
$reflectionClass = new \ReflectionClass($this->driver);
@ -97,15 +94,10 @@ class PerforceDriverTest extends TestCase
$property->setValue($this->driver, $perforce);
}
/**
* @param string $testPath
*
* @return Config
*/
protected function getTestConfig(string $testPath): Config
{
$config = new Config();
$config->merge(array('config' => array('home' => $testPath)));
$config->merge(['config' => ['home' => $testPath]]);
return $config;
}
@ -131,7 +123,7 @@ class PerforceDriverTest extends TestCase
*/
protected function getMockPerforce()
{
$methods = array('p4login', 'checkStream', 'writeP4ClientSpec', 'connectClient', 'getComposerInformation', 'cleanupClientSpec');
$methods = ['p4login', 'checkStream', 'writeP4ClientSpec', 'connectClient', 'getComposerInformation', 'cleanupClientSpec'];
return $this->getMockBuilder('Composer\Util\Perforce')->disableOriginalConstructor()->getMock();
}
@ -162,7 +154,7 @@ class PerforceDriverTest extends TestCase
{
$identifier = 'TEST_IDENTIFIER';
$formatted_depot_path = '//' . self::TEST_DEPOT . '/' . $identifier;
$this->perforce->expects($this->any())->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([]));
$this->driver->initialize();
$result = $this->driver->hasComposerFile($identifier);
$this->assertFalse($result);
@ -176,7 +168,7 @@ class PerforceDriverTest extends TestCase
{
$identifier = 'TEST_IDENTIFIER';
$formatted_depot_path = '//' . self::TEST_DEPOT . '/' . $identifier;
$this->perforce->expects($this->any())->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(['']));
$this->driver->initialize();
$result = $this->driver->hasComposerFile($identifier);
$this->assertTrue($result);
@ -186,8 +178,6 @@ class PerforceDriverTest extends TestCase
* Test that supports() simply return false.
*
* @covers \Composer\Repository\Vcs\PerforceDriver::supports
*
* @return void
*/
public function testSupportsReturnsFalseNoDeepCheck(): void
{