generated from ergebnis/php-package-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Remove autoload configuration before running tests with PHAR
- Loading branch information
1 parent
0019770
commit 9c93713
Showing
3 changed files
with
34 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -742,8 +742,13 @@ jobs: | |
name: "phpunit-slow-test-detector-phar" | ||
path: "${{ env.PHPUNIT_SLOW_TEST_DETECTOR_PHAR }}" | ||
|
||
- name: "Remove autoloader for composer" | ||
run: "composer install --ansi --no-autoloader --no-interaction" | ||
- name: "Remove autoload configuration for composer" | ||
run: "php bin/remove-autoload-configuration.php" | ||
|
||
- name: "Install ${{ matrix.dependencies }} dependencies with composer" | ||
uses: "ergebnis/.github/actions/composer/[email protected]" | ||
with: | ||
dependencies: "${{ matrix.dependencies }}" | ||
|
||
- name: "Run phar tests with phpunit/phpunit:7.5.0" | ||
if: "matrix.phpunit-version == '7.5.0'" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Copyright (c) 2021-2024 Andreas Möller | ||
* | ||
* For the full copyright and license information, please view | ||
* the LICENSE.md file that was distributed with this source code. | ||
* | ||
* @see https://github.com/ergebnis/phpunit-slow-test-detector | ||
*/ | ||
|
||
$composerJsonFile = __DIR__ . '/../composer.json'; | ||
|
||
$composerJson = \json_decode( | ||
\file_get_contents($composerJsonFile), | ||
false | ||
); | ||
|
||
$composerJson->autoload = new stdClass(); | ||
|
||
\file_put_contents($composerJsonFile, \json_encode( | ||
$composerJson, | ||
\JSON_PRETTY_PRINT | \JSON_PRESERVE_ZERO_FRACTION | \JSON_UNESCAPED_SLASHES | ||
)); |