1
0
Fork 0

Ignore ambiguous classes in tests/fixtures dirs, fixes #2858

pull/2189/merge
Jordi Boggiano 2014-03-31 21:36:48 +02:00
parent 355dc67038
commit 8974a1ac92
2 changed files with 2 additions and 1 deletions

View File

@ -84,7 +84,7 @@ class ClassMapGenerator
foreach ($classes as $class) {
if (!isset($map[$class])) {
$map[$class] = $filePath;
} elseif ($io && $map[$class] !== $filePath) {
} elseif ($io && $map[$class] !== $filePath && preg_match('{/(test|fixture)s?/}i', strtr($map[$class].' '.$filePath, '\\', '/'))) {
$io->write(
'<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>'

View File

@ -102,6 +102,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
$find->invoke(null, __DIR__.'/no-file');
}
public function testAmbiguousReference()
{
$this->checkIfFinderIsAvailable();