Skip to content

Commit 057a9b5

Browse files
[PhpUnitBridge] Fix requiring bootstrap.php
1 parent 0b386a5 commit 057a9b5

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

bin/simple-phpunit.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,6 @@
260260
if ('\\' === \DIRECTORY_SEPARATOR) {
261261
file_put_contents('composer.json', preg_replace('/^( {8})"phpunit-bridge": \{$/m', "$0\n$1 ".'"options": {"symlink": false},', file_get_contents('composer.json')));
262262
}
263-
$phpunitBridgeComposerJson = file_get_contents($path.'/composer.json');
264-
file_put_contents($path.'/composer.json', preg_replace('/^( {8})"files": .*/m', '', $phpunitBridgeComposerJson));
265263
} else {
266264
$passthruOrFail("$COMPOSER require --no-update symfony/phpunit-bridge \"*\"");
267265
}
@@ -271,9 +269,6 @@
271269
// --no-suggest is not in the list to keep compat with composer 1.0, which is shipped with Ubuntu 16.04LTS
272270
$exit = proc_close(proc_open("$q$COMPOSER install --no-dev --prefer-dist --no-progress $q", [], $p, getcwd()));
273271
putenv('COMPOSER_ROOT_VERSION'.(false !== $prevRoot ? '='.$prevRoot : ''));
274-
if (file_exists($path)) {
275-
file_put_contents($path.'/composer.json', $phpunitBridgeComposerJson);
276-
}
277272
if ($prevCacheDir) {
278273
putenv("COMPOSER_CACHE_DIR=$prevCacheDir");
279274
}

bootstrap.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
return;
2626
}
2727

28+
if (isset($fileIdentifier)) {
29+
unset($GLOBALS['__composer_autoload_files'][$fileIdentifier]);
30+
}
31+
2832
// Enforce a consistent locale
2933
setlocale(\LC_ALL, 'C');
3034

0 commit comments

Comments
 (0)