Skip to content

Commit

Permalink
Merge pull request #376 from crzdeveloper/phpunit_composer_fix
Browse files Browse the repository at this point in the history
WrapperRunner: proper PHPUNIT_COMPOSER_INSTALL constant initialization
  • Loading branch information
andreasschroth committed Feb 26, 2019
2 parents 4aa126d + b5ff2b4 commit 34094d8
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions bin/phpunit-wrapper
@@ -1,13 +1,19 @@
<?php
echo "Worker starting\n";

// git working copy
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
require_once __DIR__ . '/../vendor/autoload.php';
}
// Composer installation
if (file_exists(__DIR__ . '/../../../autoload.php')) {
require_once __DIR__ . '/../../../autoload.php';
$composerAutoloadFiles = [
__DIR__ . '/../../../autoload.php',
__DIR__ . '/../../vendor/autoload.php',
__DIR__ . '/../vendor/autoload.php'
];

foreach ($composerAutoloadFiles as $file) {
if (file_exists($file)) {
require_once $file;
define('PHPUNIT_COMPOSER_INSTALL', $file);

break;
}
}

$commands = fopen('php://stdin', 'r');
Expand Down

0 comments on commit 34094d8

Please sign in to comment.