1
0
Fork 0
mirror of https://github.com/composer/composer synced 2025-05-09 00:22:53 +00:00

fixes #3974: Autoloader have to distinguish between files and directories

This commit is contained in:
Marc Bennewitz 2015-04-30 19:17:19 +02:00
parent 1cb427ff5c
commit 9455c49053
4 changed files with 27 additions and 4 deletions

View file

@ -9,6 +9,17 @@ use Composer\Autoload\ClassLoader;
*/
class ClassLoaderTest extends \PHPUnit_Framework_TestCase
{
public function testLoadClassDotPhp()
{
$loader = new ClassLoader();
$loader->add('DirDotPhp\\', __DIR__ . '/Fixtures');
$loader->addPsr4('DirDotPhp\\', __DIR__ . '/Fixtures/DirDotPhp/psr4');
$class = 'DirDotPhp\\Dir';
$loader->loadClass($class);
$this->assertTrue(class_exists($class, false), "->loadClass() loads '$class'.");
}
/**
* Tests regular PSR-0 and PSR-4 class loading.
*