Skip to content

Commit

Permalink
PHPUnit update - use better assertion names, remove deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbundyra committed Apr 7, 2020
1 parent 4216798 commit 3ab1f1f
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 38 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"composer-plugin-api": "^1.1.0 || ^2.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0.1",
"phpunit/phpunit": "^9.1.1",
"infection/infection": "^0.15.3",
"composer/composer": "^1.9.3 || ^2.0@dev",
"ext-zip": "^1.15.0",
Expand Down
142 changes: 114 additions & 28 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions test/PackageVersionsTest/E2EInstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class E2EInstallerTest extends TestCase

private string $tempArtifact;

public function setUp() : void
protected function setUp() : void
{
$this->tempGlobalComposerHome = sys_get_temp_dir() . '/' . uniqid('InstallerTest', true) . '/global';
$this->tempLocalComposerHome = sys_get_temp_dir() . '/' . uniqid('InstallerTest', true) . '/local';
Expand All @@ -61,7 +61,7 @@ public function setUp() : void
putenv('COMPOSER_HOME=' . $this->tempGlobalComposerHome);
}

public function tearDown() : void
protected function tearDown() : void
{
$this->rmDir($this->tempGlobalComposerHome);
$this->rmDir($this->tempLocalComposerHome);
Expand Down Expand Up @@ -108,7 +108,7 @@ public function testGloballyInstalledPluginDoesNotGenerateVersionsForLocalProjec
);

$this->execComposerInDir('update', $this->tempLocalComposerHome);
$this->assertFileNotExists(
$this->assertFileDoesNotExist(
$this->tempLocalComposerHome . '/vendor/ocramius/package-versions/src/PackageVersions/Versions.php'
);
}
Expand Down Expand Up @@ -143,7 +143,7 @@ public function testRemovingPluginDoesNotAttemptToGenerateVersions() : void

$this->execComposerInDir('remove ocramius/package-versions', $this->tempLocalComposerHome);

$this->assertFileNotExists(
$this->assertFileDoesNotExist(
$this->tempLocalComposerHome . '/vendor/ocramius/package-versions/src/PackageVersions/Versions.php'
);
}
Expand Down Expand Up @@ -179,7 +179,7 @@ public function testRemovingPluginWithNoDevDoesNotAttemptToGenerateVersions() :

$this->execComposerInDir('install --no-dev', $this->tempLocalComposerHome);

$this->assertFileNotExists(
$this->assertFileDoesNotExist(
$this->tempLocalComposerHome . '/vendor/ocramius/package-versions/src/PackageVersions/Versions.php'
);
}
Expand Down Expand Up @@ -306,7 +306,7 @@ private function assertPackageVersionsIsUsable(string $directory) : void

self::assertSame(0, $exitCode);
self::assertCount(1, $output);
self::assertRegExp('/^1\\..*\\@[a-f0-9]*$/', $output[0]);
self::assertMatchesRegularExpression('/^1\\..*\\@[a-f0-9]*$/', $output[0]);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions test/PackageVersionsTest/InstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ public function testVersionsAreNotDumpedIfPackageVersionsNotExplicitlyRequired()
$this->io
));

self::assertFileNotExists($expectedPath . '/Versions.php');
self::assertFileDoesNotExist($expectedPath . '/Versions.php');

$this->rmDir($vendorDir);
}
Expand Down Expand Up @@ -705,8 +705,8 @@ public function testVersionsAreNotDumpedIfPackageIsScheduledForRemoval() : void
$this->io
));

self::assertFileNotExists($expectedPath . '/Versions.php');
self::assertFileNotExists($expectedPath . '/Versions.php');
self::assertFileDoesNotExist($expectedPath . '/Versions.php');
self::assertFileDoesNotExist($expectedPath . '/Versions.php');
}

public function testGeneratedVersionFileAccessRights() : void
Expand Down

0 comments on commit 3ab1f1f

Please sign in to comment.