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

Throw RuntimeException when ambiguous reference was found.

This commit is contained in:
Jan Brecka 2014-03-20 13:37:05 +01:00
parent 70a20ebcc1
commit 13b57112a9
4 changed files with 32 additions and 0 deletions

View file

@ -104,6 +104,22 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
$find->invoke(null, __DIR__.'/no-file');
}
/**
* @expectedException \RuntimeException
* @expectedExceptionMessage Ambiguous reference to class "A" was found.
*/
public function testAmbiguousReference()
{
if (!class_exists('Symfony\\Component\\Finder\\Finder')) {
$this->markTestSkipped('Finder component is not available');
}
$finder = new \Symfony\Component\Finder\Finder();
$finder->files()->in(__DIR__ . '/Fixtures/Ambiguous');
ClassMapGenerator::createMap($finder);
}
/**
* @expectedException \RuntimeException
* @expectedExceptionMessage Could not scan for classes inside