Skip to content

Commit

Permalink
Disable Composer platform-check in requirement-checker (#521)
Browse files Browse the repository at this point in the history
  • Loading branch information
villfa authored Jan 2, 2021
1 parent edc649b commit 83567c4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
2 changes: 0 additions & 2 deletions .requirement-checker/vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public static function getLoader()
return self::$loader;
}

require __DIR__ . '/platform_check.php';

spl_autoload_register(array('ComposerAutoloaderInit07b4f39005452b449fc512b8b494da0a', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit07b4f39005452b449fc512b8b494da0a', 'loadClassLoader'));
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"platform": {
"php": "7.3"
},
"platform-check": false,
"sort-packages": true
},
"extra": {
Expand Down
1 change: 1 addition & 0 deletions requirement-checker/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

"config": {
"bin-dir": "bin",
"platform-check": false,
"sort-packages": true
}
}
18 changes: 7 additions & 11 deletions tests/Console/Command/CompileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function test_it_can_build_a_PHAR_file(): void
$numberOfFiles = 45;
if (self::$runComposer2) {
// From Composer 2 there are more files
$numberOfFiles += 2;
++$numberOfFiles;
}

dump_file(
Expand Down Expand Up @@ -284,7 +284,6 @@ public function test_it_can_build_a_PHAR_file(): void
'/.box/vendor/composer/autoload_psr4.php',
'/.box/vendor/composer/autoload_real.php',
'/.box/vendor/composer/autoload_static.php',
'/.box/vendor/composer/platform_check.php',
'/.box/vendor/composer/semver/',
'/.box/vendor/composer/semver/LICENSE',
'/.box/vendor/composer/semver/src/',
Expand Down Expand Up @@ -323,8 +322,7 @@ public function test_it_can_build_a_PHAR_file(): void

if (!self::$runComposer2) {
$expectedFiles = array_values(array_filter($expectedFiles, static function ($file): bool {
return '/.box/vendor/composer/platform_check.php' !== $file
&& '/.box/vendor/composer/InstalledVersions.php' !== $file;
return '/.box/vendor/composer/InstalledVersions.php' !== $file;
}));
}

Expand Down Expand Up @@ -399,7 +397,7 @@ public function test_it_can_build_a_PHAR_without_any_configuration(): void
$numberOfFiles = 49;
if (self::$runComposer2) {
// From Composer 2 there are more files
$numberOfFiles += 2;
++$numberOfFiles;
}

$expected = <<<OUTPUT
Expand Down Expand Up @@ -523,7 +521,6 @@ public function test_it_can_build_a_PHAR_without_any_configuration(): void
'/.box/vendor/composer/autoload_psr4.php',
'/.box/vendor/composer/autoload_real.php',
'/.box/vendor/composer/autoload_static.php',
'/.box/vendor/composer/platform_check.php',
'/.box/vendor/composer/semver/',
'/.box/vendor/composer/semver/LICENSE',
'/.box/vendor/composer/semver/src/',
Expand Down Expand Up @@ -565,8 +562,7 @@ public function test_it_can_build_a_PHAR_without_any_configuration(): void

if (!self::$runComposer2) {
$expectedFiles = array_values(array_filter($expectedFiles, static function ($file): bool {
return '/.box/vendor/composer/platform_check.php' !== $file
&& '/.box/vendor/composer/InstalledVersions.php' !== $file;
return '/.box/vendor/composer/InstalledVersions.php' !== $file;
}));
}

Expand Down Expand Up @@ -835,7 +831,7 @@ public function test_it_can_build_a_PHAR_file_in_verbose_mode(): void
if (self::$runComposer2) {
// From Composer 2 there are more files
++$numberOfClasses;
$numberOfFiles += 2;
++$numberOfFiles;
}

dump_file(
Expand Down Expand Up @@ -957,7 +953,7 @@ public function test_it_can_build_a_PHAR_file_in_very_verbose_mode(): void
if (self::$runComposer2) {
// From Composer 2 there are more files
++$numberOfClasses;
$numberOfFiles += 2;
++$numberOfFiles;
}

dump_file(
Expand Down Expand Up @@ -2916,7 +2912,7 @@ public function test_it_can_generate_a_PHAR_with_docker(): void
$numberOfFiles = 41;
if (self::$runComposer2) {
// From Composer 2 there are more files
$numberOfFiles += 2;
++$numberOfFiles;
}

$expected = <<<OUTPUT
Expand Down
3 changes: 1 addition & 2 deletions tests/RequirementChecker/RequirementsDumperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ public function test_it_dumps_the_requirement_checker_files(
'vendor/composer/semver/src/VersionParser.php',
];

if (file_exists(__DIR__.'/../../.requirement-checker/vendor/composer/platform_check.php')) {
if (file_exists(__DIR__.'/../../.requirement-checker/vendor/composer/InstalledVersions.php')) {
$expectedFiles[] = 'vendor/composer/InstalledVersions.php';
$expectedFiles[] = 'vendor/composer/platform_check.php';
}

sort($expectedFiles);
Expand Down

0 comments on commit 83567c4

Please sign in to comment.