File tree Expand file tree Collapse file tree 10 files changed +84
-7
lines changed Expand file tree Collapse file tree 10 files changed +84
-7
lines changed Original file line number Diff line number Diff line change 33/dist /
44/build /
55/composer.lock
6+ /fixtures /* /vendor
67/vendor /
78/vendor-bin /box /vendor /
89/vendor-bin /box /composer.lock
Original file line number Diff line number Diff line change 1313matrix :
1414 include :
1515 - php : ' 7.0'
16+ env : COVERAGE='true'
1617 - php : ' 7.1'
1718 - php : ' 7.1'
1819 env : COMPOSER_FLAGS='--prefer-lowest'
@@ -23,6 +24,22 @@ matrix:
2324
2425before_script : phpenv config-rm xdebug.ini || true
2526
26- install : composer update --no-interaction --no-progress --no-suggest --prefer-dist $COMPOSER_FLAGS
27+ install :
28+ - set -eo pipefail
29+ - composer update --no-interaction --no-progress --no-suggest --prefer-dist $COMPOSER_FLAGS
30+ - |
31+ if [ "$COVERAGE" == "true" ]; then
32+ composer bin box update --no-interaction --no-progress --no-suggest --prefer-dist $COMPOSER_FLAGS
33+ fi
2734
28- script : phpdbg -qrr vendor/bin/phpunit --verbose --coverage-text
35+ script :
36+ - |
37+ if [ "$COVERAGE" == "true" ]; then
38+ make tc
39+ make e2e
40+ else
41+ make tu
42+ fi
43+
44+ notifications :
45+ email : false
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ BOX=vendor-bin/box/vendor/bin/box
22PHPUNIT =vendor/bin/phpunit
33
44.DEFAULT_GOAL := help
5- .PHONY : build test tc
5+ .PHONY : build test tu tc e2e
66
77
88help :
@@ -29,14 +29,25 @@ build: bin/php-scoper
2929# # Tests
3030# #---------------------------------------------------------------------------
3131
32- test : # # Run PHPUnit tests
33- test : vendor
32+ test : # # Run all the tests
33+ test : tu e2e
34+
35+ tu : # # Run PHPUnit tests
36+ tu : vendor
3437 php -d zend.enable_gc=0 $(PHPUNIT )
3538
3639tc : # # Run PHPUnit tests with test coverage
3740tc : vendor
3841 phpdbg -qrr -d zend.enable_gc=0 $(PHPUNIT ) --coverage-html=dist/coverage --coverage-text
3942
43+ e2e : # # Run end-to-end tests
44+ e2e : vendor
45+ php -d zend.enable_gc=0 bin/php-scoper add-prefix fixtures/set004 -o build/set004 -f
46+ composer -d=build/set004 dump-autoload
47+ php -d zend.enable_gc=0 $(BOX ) build -c build/set004/box.json.dist
48+ php build/set004/bin/greet.phar > build/output
49+ diff fixtures/set004/expected-output build/output
50+
4051
4152# #
4253# # Rules from files
Original file line number Diff line number Diff line change @@ -54,4 +54,4 @@ install:
5454
5555test_script :
5656 - cd c:\projects\webmozart\php-scoper
57- - vendor\bin\phpunit -c phpunit.xml.dist
57+ - make tu
Original file line number Diff line number Diff line change 1010 * file that was distributed with this source code.
1111 */
1212
13- use function Humbug \PhpScoper \ create_application ;
13+ namespace Humbug \PhpScoper ;
1414
1515if (file_exists ($ autoload = __DIR__ .'/../../../autoload.php ' )) {
1616 require_once $ autoload ;
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ require_once __DIR__ .'/../vendor/autoload.php ' ;
6+
7+ use Set004 \Greeter ;
8+
9+ echo (new Greeter ())->greet ().PHP_EOL ;
Original file line number Diff line number Diff line change 1+ {
2+ "output": "build/set004/bin/greet.phar",
3+ "main": "bin/greet.php",
4+ "base-path": "build/set004",
5+ "directories": [
6+ "src",
7+ "vendor"
8+ ],
9+ "compression": "GZ",
10+ "compactors": [
11+ "Herrera\\Box\\Compactor\\Json",
12+ "Herrera\\Box\\Compactor\\Php"
13+ ],
14+ "stub": true
15+ }
Original file line number Diff line number Diff line change 1+ {
2+ "bin" : [
3+ " bin/greet"
4+ ],
5+ "autoload" : {
6+ "psr-4" : {
7+ "Set004\\ " : " src/"
8+ }
9+ }
10+ }
Original file line number Diff line number Diff line change 1+ Hello world!
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Set004 ;
6+
7+ class Greeter
8+ {
9+ public function greet (): string
10+ {
11+ return 'Hello world! ' ;
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments