diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 2acfa9f2..e4eb7be5 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -99,6 +99,10 @@ jobs: composer: - 'composer:2.2' - 'composer' + include: + - e2e: 'e2e_039' + php: '8.1' + composer: 'composer:2.2' steps: - name: Checkout diff --git a/.makefile/e2e.file b/.makefile/e2e.file index b8f5c615..1f2527c8 100644 --- a/.makefile/e2e.file +++ b/.makefile/e2e.file @@ -404,6 +404,32 @@ _e2e_038: @# To keep in sync with .github/workflows/e2e-tests.yaml#test-phpunit-scoping cd $(E2E_PHPUNIT_DIR); XDEBUG_MODE=coverage ant run-phar-specific-tests +.PHONY: e2e_039 +e2e_039: # Runs end-to-end tests for the fixture set e2e_037 — Codebase using scoped code +e2e_039: $(PHP_SCOPER_PHAR_BIN) + rm -rf fixtures/set039-min-php-version/vendor || true + + composer --working-dir=fixtures/set039-min-php-version install + + $(PHP_SCOPER_PHAR) add-prefix . \ + --working-dir=fixtures/set039-min-php-version \ + --output-dir=../../build/set039 \ + --force \ + --no-interaction \ + --stop-on-failure + composer --working-dir=build/set039 dump-autoload + + docker run \ + --interactive \ + --platform=linux/amd64 \ + --rm \ + --workdir=/opt/php-scoper \ + --volume="$$PWD":/opt/php-scoper \ + php:7.2-cli-alpine \ + php build/set039/index.php \ + > build/set039/output + diff fixtures/set039-min-php-version/expected-output build/set039/output + # # Rules from files diff --git a/Makefile b/Makefile index cc4f0bf9..675caa41 100644 --- a/Makefile +++ b/Makefile @@ -171,7 +171,8 @@ e2e: e2e_004 \ e2e_035 \ e2e_036 \ e2e_037 \ - e2e_038 + e2e_038 \ + e2e_039 .PHONY: blackfire blackfire: ## Runs Blackfire profiling diff --git a/fixtures/set039-min-php-version/composer.json b/fixtures/set039-min-php-version/composer.json new file mode 100644 index 00000000..2c63c085 --- /dev/null +++ b/fixtures/set039-min-php-version/composer.json @@ -0,0 +1,2 @@ +{ +} diff --git a/fixtures/set039-min-php-version/composer.lock b/fixtures/set039-min-php-version/composer.lock new file mode 100644 index 00000000..ba6fe47d --- /dev/null +++ b/fixtures/set039-min-php-version/composer.lock @@ -0,0 +1,18 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "d751713988987e9331980363e24189ce", + "packages": [], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/fixtures/set039-min-php-version/expected-output b/fixtures/set039-min-php-version/expected-output new file mode 100644 index 00000000..d86bac9d --- /dev/null +++ b/fixtures/set039-min-php-version/expected-output @@ -0,0 +1 @@ +OK diff --git a/fixtures/set039-min-php-version/index.php b/fixtures/set039-min-php-version/index.php new file mode 100644 index 00000000..504abd53 --- /dev/null +++ b/fixtures/set039-min-php-version/index.php @@ -0,0 +1,11 @@ + $fileInfo->getPathName(), + iterator_to_array( + Finder::create()->files()->in(__DIR__), + false, + ), +); + +return [ + 'expose-classes' => ['App\Greeter'], +]; diff --git a/tests/AutoReview/GAE2ETest.php b/tests/AutoReview/GAE2ETest.php index d647fc9c..d716fd1e 100644 --- a/tests/AutoReview/GAE2ETest.php +++ b/tests/AutoReview/GAE2ETest.php @@ -26,6 +26,7 @@ class GAE2ETest extends TestCase { private const IGNORED_E2E_TESTS = [ 'e2e_038', + 'e2e_039', ]; public function test_github_actions_executes_all_the_e2e_tests(): void