File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed
fixtures/set020-infection Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change 1818
1919clean : # # Clean all created artifacts
2020clean :
21- git clean --exclude=.idea/ -fdx
21+ git clean --exclude=.idea/ -ffdx
2222
2323build : # # Build the PHAR
2424build : bin/php-scoper src vendor vendor-bin/box/vendor scoper.inc.php box.json
@@ -154,7 +154,15 @@ e2e_020: bin/php-scoper.phar fixtures/set020-infection/vendor
154154 php -d zend.enable_gc=0 $(PHPSCOPER ) add-prefix --working-dir=fixtures/set020-infection --output-dir=../../build/set020-infection --force --no-interaction --stop-on-failure
155155 composer --working-dir=build/set020-infection dump-autoload
156156
157- php build/set020-infection/vendor/infection/infection/bin/infection
157+ # Create coverage reports to be able to run Infection without running the tests
158+ php -d zend.enable_gc=0 $(PHPUNIT) --coverage-clover=clover.xml --coverage-xml=dist/infection-coverage/coverage-xml --log-junit=dist/infection-coverage/phpunit.junit.xml
159+
160+ php fixtures/set020-infection/vendor/infection/infection/bin/infection --coverage=dist/infection-coverage > build/set020-infection/expected-output
161+ php build/set020-infection/vendor/infection/infection/bin/infection --coverage=dist/infection-coverage > build/set020-infection/output
162+
163+ rm clover.xml
164+
165+ diff build/set020-infection/expected-output build/set020-infection/output
158166
159167tb : # # Run Blackfire profiling
160168tb : vendor
Original file line number Diff line number Diff line change 1717return [
1818 'patchers ' => [
1919 function (string $ filePath , string $ prefix , string $ contents ): string {
20+ //
21+ // Infection shared global constant patch
22+ // @see https://github.com/humbug/php-scoper/issues/171
23+ //
2024 if ($ filePath === realpath (__DIR__ .'/vendor/infection/infection/app/bootstrap.php ' )) {
2125 return str_replace ($ prefix .'\INFECTION_COMPOSER_INSTALL; ' , 'INFECTION_COMPOSER_INSTALL; ' , $ contents );
2226 }
2327
2428 return $ contents ;
2529 },
30+ function (string $ filePath , string $ prefix , string $ contents ): string {
31+ //
32+ // Infection IncludeInterceptor patch
33+ //
34+ if ($ filePath === realpath (__DIR__ .'/vendor/infection/infection/src/TestFramework/Config/MutationConfigBuilder.php ' )) {
35+ return str_replace (
36+ 'use Infection \\\\StreamWrapper \\\\IncludeInterceptor; ' ,
37+ 'use ' .$ prefix .'\\\\Infection \\\\StreamWrapper \\\\IncludeInterceptor; ' ,
38+ $ contents
39+ );
40+ }
41+
42+ return $ contents ;
43+ },
2644 function (string $ filePath , string $ prefix , string $ contents ): string {
2745 //
2846 // PHP-Parser patch
You can’t perform that action at this time.
0 commit comments