1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-10 09:02:59 +00:00

Fix optimized autoloader generation for PSR-0 configs that include non-existent dirs, fixes #1286

This commit is contained in:
Jordi Boggiano 2012-11-27 14:23:10 +01:00
parent ead17b2680
commit c5f3a6febd
2 changed files with 21 additions and 0 deletions

View file

@ -212,6 +212,24 @@ class AutoloadGeneratorTest extends TestCase
$this->assertTrue(file_exists($this->vendorDir.'/composer/autoload_classmap.php'), "ClassMap file needs to be generated, even if empty.");
}
public function testPSR0ToClassMapIgnoresNonExistingDir()
{
$package = new Package('a', '1.0', '1.0');
$package->setAutoload(array('psr-0' => array('foo/bar/non/existing/')));
$this->repository->expects($this->once())
->method('getPackages')
->will($this->returnValue(array()));
$this->generator->dump($this->config, $this->repository, $package, $this->im, 'composer', true, '_8');
$this->assertTrue(file_exists($this->vendorDir.'/composer/autoload_classmap.php'), "ClassMap file needs to be generated.");
$this->assertEquals(
array(),
include $this->vendorDir.'/composer/autoload_classmap.php'
);
}
public function testVendorsClassMapAutoloading()
{
$package = new Package('a', '1.0', '1.0');