Always include the ClassLoader since autoload_real is included only once, refs #963

main
Jordi Boggiano 12 years ago
parent 30fdf379aa
commit 4f0ad98905

@ -311,9 +311,7 @@ AUTOLOAD;
// autoload_real$suffix.php generated by Composer
if (!class_exists('Composer\\\\Autoload\\\\ClassLoader', false)) {
require __DIR__ . '/ClassLoader.php';
}
require __DIR__ . '/ClassLoader.php';
class ComposerAutoloaderInit$suffix
{

@ -278,6 +278,9 @@ class AutoloadGeneratorTest extends TestCase
$this->assertFileEquals(__DIR__.'/Fixtures/autoload_functions.php', $this->vendorDir.'/autoload.php');
$this->assertFileEquals(__DIR__.'/Fixtures/autoload_real_functions.php', $this->vendorDir.'/composer/autoload_realFilesAutoload.php');
// suppress the class loader to avoid fatals if the class is redefined
file_put_contents($this->vendorDir.'/composer/ClassLoader.php', '');
include $this->vendorDir . '/autoload.php';
$this->assertTrue(function_exists('testFilesAutoloadGeneration1'));
$this->assertTrue(function_exists('testFilesAutoloadGeneration2'));
@ -360,6 +363,9 @@ class AutoloadGeneratorTest extends TestCase
$oldIncludePath = get_include_path();
// suppress the class loader to avoid fatals if the class is redefined
file_put_contents($this->vendorDir.'/composer/ClassLoader.php', '');
require($this->vendorDir."/autoload.php");
$this->assertEquals(

@ -2,9 +2,7 @@
// autoload_realFilesAutoload.php generated by Composer
if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
require __DIR__ . '/ClassLoader.php';
}
require __DIR__ . '/ClassLoader.php';
class ComposerAutoloaderInitFilesAutoload
{

@ -2,9 +2,7 @@
// autoload_realTargetDir.php generated by Composer
if (!class_exists('Composer\\Autoload\\ClassLoader', false)) {
require __DIR__ . '/ClassLoader.php';
}
require __DIR__ . '/ClassLoader.php';
class ComposerAutoloaderInitTargetDir
{

Loading…
Cancel
Save