File tree Expand file tree Collapse file tree 9 files changed +91
-1
lines changed
fixtures/set039-min-php-version Expand file tree Collapse file tree 9 files changed +91
-1
lines changed Original file line number Diff line number Diff line change 9999 composer :
100100 - ' composer:2.2'
101101 - ' composer'
102+ include :
103+ - e2e : ' e2e_039'
104+ php : ' 8.1'
105+ composer : ' composer:2.2'
102106
103107 steps :
104108 - name : Checkout
Original file line number Diff line number Diff line change @@ -404,6 +404,32 @@ _e2e_038:
404404 @# To keep in sync with .github/workflows/e2e-tests.yaml#test-phpunit-scoping
405405 cd $(E2E_PHPUNIT_DIR); XDEBUG_MODE=coverage ant run-phar-specific-tests
406406
407+ .PHONY: e2e_039
408+ e2e_039: # Runs end-to-end tests for the fixture set e2e_037 — Codebase using scoped code
409+ e2e_039: $(PHP_SCOPER_PHAR_BIN)
410+ rm -rf fixtures/set039-min-php-version/vendor || true
411+
412+ composer --working-dir=fixtures/set039-min-php-version install
413+
414+ $(PHP_SCOPER_PHAR) add-prefix . \
415+ --working-dir=fixtures/set039-min-php-version \
416+ --output-dir=../../build/set039 \
417+ --force \
418+ --no-interaction \
419+ --stop-on-failure
420+ composer --working-dir=build/set039 dump-autoload
421+
422+ docker run \
423+ --interactive \
424+ --platform=linux/amd64 \
425+ --rm \
426+ --workdir=/opt/php-scoper \
427+ --volume="$$PWD":/opt/php-scoper \
428+ php:7.2-cli-alpine \
429+ php build/set039/index.php \
430+ > build/set039/output
431+ diff fixtures/set039-min-php-version/expected-output build/set039/output
432+
407433
408434#
409435# Rules from files
Original file line number Diff line number Diff line change @@ -171,7 +171,8 @@ e2e: e2e_004 \
171171 e2e_035 \
172172 e2e_036 \
173173 e2e_037 \
174- e2e_038
174+ e2e_038 \
175+ e2e_039
175176
176177.PHONY : blackfire
177178blackfire : # # Runs Blackfire profiling
Original file line number Diff line number Diff line change 1+ {
2+ }
Original file line number Diff line number Diff line change 1+ OK
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace App ;
4+
5+ require file_exists (__DIR__ .'/vendor/scoper-autoload.php ' )
6+ ? __DIR__ .'/vendor/scoper-autoload.php '
7+ : __DIR__ .'/vendor/autoload.php ' ;
8+
9+ class Greeter {}
10+
11+ echo "OK \n" ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Isolated \Symfony \Component \Finder \Finder ;
6+
7+ // You can do your own things here, e.g. collecting symbols to expose dynamically
8+ // or files to exclude.
9+ // However beware that this file is executed by PHP-Scoper, hence if you are using
10+ // the PHAR it will be loaded by the PHAR. So it is highly recommended to avoid
11+ // to auto-load any code here: it can result in a conflict or even corrupt
12+ // the PHP-Scoper analysis.
13+
14+ // Example of collecting files to include in the scoped build but to not scope
15+ // leveraging the isolated finder.
16+ $ excludedFiles = array_map (
17+ static fn (SplFileInfo $ fileInfo ) => $ fileInfo ->getPathName (),
18+ iterator_to_array (
19+ Finder::create ()->files ()->in (__DIR__ ),
20+ false ,
21+ ),
22+ );
23+
24+ return [
25+ 'expose-classes ' => ['App\Greeter ' ],
26+ ];
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ class GAE2ETest extends TestCase
2626{
2727 private const IGNORED_E2E_TESTS = [
2828 'e2e_038 ' ,
29+ 'e2e_039 ' ,
2930 ];
3031
3132 public function test_github_actions_executes_all_the_e2e_tests (): void
You can’t perform that action at this time.
0 commit comments