mirror of
https://github.com/composer/composer
synced 2025-05-10 09:02:59 +00:00
Fix CS (#11003)
This commit is contained in:
parent
6e205a0c84
commit
131da999ac
357 changed files with 5943 additions and 9174 deletions
|
@ -52,12 +52,12 @@ class PerforceTest extends TestCase
|
|||
*/
|
||||
public function getTestRepoConfig(): array
|
||||
{
|
||||
return array(
|
||||
return [
|
||||
'depot' => self::TEST_DEPOT,
|
||||
'branch' => self::TEST_BRANCH,
|
||||
'p4user' => self::TEST_P4USER,
|
||||
'unique_perforce_client_name' => self::TEST_CLIENT_NAME,
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,11 +68,6 @@ class PerforceTest extends TestCase
|
|||
return $this->getMockBuilder('Composer\IO\IOInterface')->getMock();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $flag
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function createNewPerforceWithWindowsFlag(bool $flag): void
|
||||
{
|
||||
$this->perforce = new Perforce($this->repoConfig, self::TEST_PORT, self::TEST_PATH, $this->processExecutor, $flag, $this->io);
|
||||
|
@ -225,12 +220,12 @@ class PerforceTest extends TestCase
|
|||
|
||||
public function testQueryP4PasswordWithPasswordAlreadySet(): void
|
||||
{
|
||||
$repoConfig = array(
|
||||
$repoConfig = [
|
||||
'depot' => 'depot',
|
||||
'branch' => 'branch',
|
||||
'p4user' => 'user',
|
||||
'p4password' => 'TEST_PASSWORD',
|
||||
);
|
||||
];
|
||||
$this->perforce = new Perforce($repoConfig, 'port', 'path', $this->processExecutor, false, $this->getMockIOInterface());
|
||||
$password = $this->perforce->queryP4Password();
|
||||
$this->assertEquals('TEST_PASSWORD', $password);
|
||||
|
@ -451,12 +446,12 @@ class PerforceTest extends TestCase
|
|||
);
|
||||
|
||||
$result = $this->perforce->getComposerInformation('//depot');
|
||||
$expected = array(
|
||||
$expected = [
|
||||
'name' => 'test/perforce',
|
||||
'description' => 'Basic project for testing',
|
||||
'minimum-stability' => 'dev',
|
||||
'autoload' => array('psr-0' => array()),
|
||||
);
|
||||
'autoload' => ['psr-0' => []],
|
||||
];
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
@ -478,12 +473,12 @@ class PerforceTest extends TestCase
|
|||
|
||||
$result = $this->perforce->getComposerInformation('//depot@0.0.1');
|
||||
|
||||
$expected = array(
|
||||
$expected = [
|
||||
'name' => 'test/perforce',
|
||||
'description' => 'Basic project for testing',
|
||||
'minimum-stability' => 'dev',
|
||||
'autoload' => array('psr-0' => array()),
|
||||
);
|
||||
'autoload' => ['psr-0' => []],
|
||||
];
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
@ -503,12 +498,12 @@ class PerforceTest extends TestCase
|
|||
|
||||
$result = $this->perforce->getComposerInformation('//depot/branch');
|
||||
|
||||
$expected = array(
|
||||
$expected = [
|
||||
'name' => 'test/perforce',
|
||||
'description' => 'Basic project for testing',
|
||||
'minimum-stability' => 'dev',
|
||||
'autoload' => array('psr-0' => array()),
|
||||
);
|
||||
'autoload' => ['psr-0' => []],
|
||||
];
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
@ -532,12 +527,12 @@ class PerforceTest extends TestCase
|
|||
|
||||
$result = $this->perforce->getComposerInformation('//depot/branch@0.0.1');
|
||||
|
||||
$expected = array(
|
||||
$expected = [
|
||||
'name' => 'test/perforce',
|
||||
'description' => 'Basic project for testing',
|
||||
'minimum-stability' => 'dev',
|
||||
'autoload' => array('psr-0' => array()),
|
||||
);
|
||||
'autoload' => ['psr-0' => []],
|
||||
];
|
||||
$this->assertEquals($expected, $result);
|
||||
}
|
||||
|
||||
|
@ -578,8 +573,6 @@ class PerforceTest extends TestCase
|
|||
* Test if "p4" command is missing.
|
||||
*
|
||||
* @covers \Composer\Util\Perforce::checkServerExists
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testCheckServerClientError(): void
|
||||
{
|
||||
|
@ -595,9 +588,6 @@ class PerforceTest extends TestCase
|
|||
$this->assertFalse($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public static function getComposerJson(): string
|
||||
{
|
||||
return JsonFile::encode([
|
||||
|
@ -611,13 +601,11 @@ class PerforceTest extends TestCase
|
|||
}
|
||||
|
||||
/**
|
||||
* @param bool $withStream
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
private function getExpectedClientSpec(bool $withStream): array
|
||||
{
|
||||
$expectedArray = array(
|
||||
$expectedArray = [
|
||||
'Client: composer_perforce_TEST_depot',
|
||||
PHP_EOL,
|
||||
'Update:',
|
||||
|
@ -636,7 +624,7 @@ class PerforceTest extends TestCase
|
|||
PHP_EOL,
|
||||
'LineEnd: local',
|
||||
PHP_EOL,
|
||||
);
|
||||
];
|
||||
if ($withStream) {
|
||||
$expectedArray[] = 'Stream:';
|
||||
$expectedArray[] = ' //depot/branch';
|
||||
|
@ -647,9 +635,6 @@ class PerforceTest extends TestCase
|
|||
return $expectedArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private function setPerforceToStream(): void
|
||||
{
|
||||
$this->perforce->setStream('//depot/branch');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue