Ignore ambiguous classes in tests/fixtures dirs, fixes #2858
parent
355dc67038
commit
8974a1ac92
|
@ -84,7 +84,7 @@ class ClassMapGenerator
|
||||||
foreach ($classes as $class) {
|
foreach ($classes as $class) {
|
||||||
if (!isset($map[$class])) {
|
if (!isset($map[$class])) {
|
||||||
$map[$class] = $filePath;
|
$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(
|
$io->write(
|
||||||
'<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
|
'<warning>Warning: Ambiguous class resolution, "'.$class.'"'.
|
||||||
' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>'
|
' was found in both "'.$map[$class].'" and "'.$filePath.'", the first will be used.</warning>'
|
||||||
|
|
|
@ -102,6 +102,7 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
$find->invoke(null, __DIR__.'/no-file');
|
$find->invoke(null, __DIR__.'/no-file');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAmbiguousReference()
|
public function testAmbiguousReference()
|
||||||
{
|
{
|
||||||
$this->checkIfFinderIsAvailable();
|
$this->checkIfFinderIsAvailable();
|
||||||
|
|
Loading…
Reference in New Issue