Skip to content

Commit

Permalink
Merge pull request #844 from whatthejeff/autoload_confusion
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Mar 2, 2013
2 parents 956132b + 0996428 commit 605a5c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions PHPUnit/Autoload.php
Expand Up @@ -42,6 +42,10 @@
* @since File available since Release 3.5.0
*/

if (defined('PHPUNIT_COMPOSER_INSTALL')) {
return;
}

require_once 'File/Iterator/Autoload.php';
require_once 'PHP/CodeCoverage/Autoload.php';
require_once 'PHP/Timer/Autoload.php';
Expand Down
4 changes: 4 additions & 0 deletions PHPUnit/Autoload.php.in
Expand Up @@ -42,6 +42,10 @@
* @since File available since Release 3.5.0
*/

if (defined('PHPUNIT_COMPOSER_INSTALL')) {
return;
}

require_once 'File/Iterator/Autoload.php';
require_once 'PHP/CodeCoverage/Autoload.php';
require_once 'PHP/Timer/Autoload.php';
Expand Down
6 changes: 2 additions & 4 deletions composer/bin/phpunit
Expand Up @@ -42,19 +42,17 @@ $files = array(
__DIR__ . '/../../../../autoload.php'
);

$found = FALSE;

foreach ($files as $file) {
if (file_exists($file)) {
require $file;

$found = TRUE;
define('PHPUNIT_COMPOSER_INSTALL', TRUE);

break;
}
}

if (!$found) {
if (!defined('PHPUNIT_COMPOSER_INSTALL')) {
die(
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
'curl -s http://getcomposer.org/installer | php' . PHP_EOL .
Expand Down

0 comments on commit 605a5c0

Please sign in to comment.