1
0
Fork 0

PhpStan fixes

pull/11678/head
Jakob Vibe 2023-10-05 19:03:58 +02:00
parent ff49b3bb47
commit 207de4ef6c
1 changed files with 6 additions and 4 deletions

View File

@ -139,7 +139,6 @@ class InitCommandTest extends TestCase
{ {
$command = new DummyInitCommand; $command = new DummyInitCommand;
$gitConfig = $command->getGitConfig(); $gitConfig = $command->getGitConfig();
$this->assertIsArray($gitConfig);
$this->assertArrayHasKey('user.name', $gitConfig); $this->assertArrayHasKey('user.name', $gitConfig);
$this->assertArrayHasKey('user.email', $gitConfig); $this->assertArrayHasKey('user.email', $gitConfig);
$this->assertArrayHasKey('remote.origin.url', $gitConfig); $this->assertArrayHasKey('remote.origin.url', $gitConfig);
@ -148,16 +147,19 @@ class InitCommandTest extends TestCase
public function testAddVendorIgnore(): void public function testAddVendorIgnore(): void
{ {
$command = new DummyInitCommand; $command = new DummyInitCommand;
$ignoreFile = $this->getUniqueTmpDirectory().'/ignore'; $ignoreFile = self::getUniqueTmpDirectory().'/ignore';
$command->addVendorIgnore($ignoreFile); $command->addVendorIgnore($ignoreFile);
$this->assertFileExists($ignoreFile); $this->assertFileExists($ignoreFile);
$this->assertStringContainsString('/vendor/', file_get_contents($ignoreFile)); if (file_exists($ignoreFile)) {
$content = (string) file_get_contents($ignoreFile);
$this->assertStringContainsString('/vendor/', $content);
}
} }
public function testHasVendorIgnore(): void public function testHasVendorIgnore(): void
{ {
$command = new DummyInitCommand; $command = new DummyInitCommand;
$ignoreFile = $this->getUniqueTmpDirectory().'/ignore'; $ignoreFile = self::getUniqueTmpDirectory().'/ignore';
$this->assertFalse($command->hasVendorIgnore($ignoreFile)); $this->assertFalse($command->hasVendorIgnore($ignoreFile));
$command->addVendorIgnore($ignoreFile); $command->addVendorIgnore($ignoreFile);
$this->assertTrue($command->hasVendorIgnore($ignoreFile)); $this->assertTrue($command->hasVendorIgnore($ignoreFile));