From 17c3e23142958e0433def58d893a73a9eeafe45c Mon Sep 17 00:00:00 2001 From: Joseph Bielawski Date: Mon, 7 Nov 2011 19:43:18 +0100 Subject: [PATCH] Allow running tests even if Composer is not installed through itself ;-) --- tests/bootstrap.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index f27fe2512..2b5a7367d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -10,4 +10,14 @@ * file that was distributed with this source code. */ -require __DIR__.'/../vendor/.composer/autoload.php'; +if (file_exists(__DIR__.'/../vendor/.composer/autoload.php')) { + require __DIR__.'/../vendor/.composer/autoload.php'; +} else { + require __DIR__.'/../src/Composer/Autoload/ClassLoader.php'; + + $loader = new Composer\Autoload\ClassLoader(); + $loader->add('Composer\\', dirname(__DIR__).'/src/'); + $loader->add('Symfony\\Component\\', dirname(__DIR__).'/src/'); + $loader->add('Composer_', dirname(__DIR__).'/src/'); + $loader->register(); +} \ No newline at end of file