File tree Expand file tree Collapse file tree 8 files changed +66
-3
lines changed
Expand file tree Collapse file tree 8 files changed +66
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ install:
1212- if [[ $deps = low ]]; then make update-min; else make install; fi
1313script :
1414- if [[ $deps = low ]]; then make test-min; else make test; fi
15- - make package
15+ - make package test-package
1616deploy :
1717 provider : releases
1818 api_key :
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ test: vendor cs phpunit
2525test-min : update-min cs phpunit
2626.PHONY : test-min
2727
28+ test-package : package test-package-tools
29+ cd tests/phar && ./tools/phpunit
30+ .PHONY : test-package
31+
2832cs : tools/php-cs-fixer
2933 tools/php-cs-fixer --dry-run --allow-risky=yes --no-interaction --ansi fix
3034.PHONY : cs
@@ -39,6 +43,9 @@ phpunit: tools/phpunit
3943
4044clean :
4145 rm -rf build
46+ rm -rf vendor
47+ find tools -not -path ' */\.*' -type f -delete
48+ find tests/phar/tools -not -path ' */\.*' -type f -delete
4249.PHONY : clean
4350
4451package : tools/box
@@ -72,4 +79,15 @@ tools/php-cs-fixer:
7279 curl -Ls http://cs.sensiolabs.org/download/php-cs-fixer-v2.phar -o tools/php-cs-fixer && chmod +x tools/php-cs-fixer
7380
7481tools/box :
75- curl -Ls https://github.com/humbug/box/releases/download/3.0.0-beta.0/box.phar -o tools/box && chmod +x tools/box
82+ curl -Ls https://github.com/humbug/box/releases/download/3.0.0-beta.4/box.phar -o tools/box && chmod +x tools/box
83+
84+ test-package-tools : tests/phar/tools/phpunit tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar
85+ .PHONY : test-package-tools
86+
87+ tests/phar/tools/phpunit :
88+ curl -Ls https://phar.phpunit.de/phpunit-7.phar -o tests/phar/tools/phpunit && chmod +x tests/phar/tools/phpunit
89+
90+ tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar : build/zalas-phpunit-globals-extension.phar
91+ cp build/zalas-phpunit-globals-extension.phar tests/phar/tools/phpunit.d/zalas-phpunit-globals-extension.phar
92+
93+ build/zalas-phpunit-globals-extension.phar : package
Original file line number Diff line number Diff line change 1212 "",
1313 "(c) Jakub Zalas <
[email protected] >"
1414 ]
15- }
15+ }
Original file line number Diff line number Diff line change 88 verbose =" true" >
99 <testsuite name =" default" >
1010 <directory suffix =" Test.php" >tests</directory >
11+ <exclude >tests/phar</exclude >
1112 </testsuite >
1213
1314 <filter >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/7.2/phpunit.xsd"
4+ beStrictAboutOutputDuringTests =" true"
5+ beStrictAboutTodoAnnotatedTests =" true"
6+ verbose =" true"
7+ extensionsDirectory =" tools/phpunit.d" >
8+ <testsuites >
9+ <testsuite name =" default" >
10+ <directory suffix =" Test.php" >tests</directory >
11+ </testsuite >
12+ </testsuites >
13+
14+ <listeners >
15+ <listener class =" Zalas\PHPUnit\Globals\AnnotationListener" />
16+ </listeners >
17+
18+ <filter >
19+ <whitelist processUncoveredFilesFromWhitelist =" true" >
20+ <directory suffix =" .php" >src</directory >
21+ </whitelist >
22+ </filter >
23+ </phpunit >
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ use PHPUnit \Framework \TestCase ;
5+
6+ class PharTest extends TestCase
7+ {
8+ /**
9+ * @env APP_ENV=test_foo
10+ * @server APP_DEBUG=1
11+ */
12+ public function test_it_reads_global_variables_from_method_annotations ()
13+ {
14+ $ this ->assertArraySubset (['APP_ENV ' => 'test_foo ' ], $ _ENV );
15+ $ this ->assertArraySubset (['APP_DEBUG ' => '1 ' ], $ _SERVER );
16+ }
17+ }
Original file line number Diff line number Diff line change 1+ *
2+ ! .gitignore
Original file line number Diff line number Diff line change 1+ *
2+ ! .gitignore
You can’t perform that action at this time.
0 commit comments