Skip to content

Commit

Permalink
Removed redundant check for the existence of `InstalledVersions::getA…
Browse files Browse the repository at this point in the history
…llRawData()`

This method always exists as per `composer/composer:^2.0.14`
  • Loading branch information
Ocramius committed May 25, 2021
1 parent 8676fe5 commit 6046a57
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use PHPUnit\Framework\TestCase;
use ProxyManager\Generator\Util\IdentifierSuffixer;

use function is_callable;
use function serialize;
use function sha1;
use function strlen;
Expand Down Expand Up @@ -38,11 +37,7 @@ public function testGeneratesSuffixedIdentifiers(string $name): void
*/
public function testGeneratedSuffixDependsOnPackageInstalledVersions(string $name): void
{
$hashedData = sha1(serialize(
is_callable([InstalledVersions::class, 'getAllRawData'])
? InstalledVersions::getAllRawData()
: InstalledVersions::getRawData()
));
$hashedData = sha1(serialize(InstalledVersions::getAllRawData()));

self::assertStringEndsWith(
substr(sha1($name . $hashedData), 0, 5),
Expand Down

0 comments on commit 6046a57

Please sign in to comment.