mirror of
https://github.com/composer/composer
synced 2025-05-09 00:22:53 +00:00
Don't show Ambiguous class resolution warning if class when not ambiguous
if a class or interface is defined twice in the same class, this should not produce a warning
This commit is contained in:
parent
7daf876d70
commit
e3be04c443
3 changed files with 28 additions and 1 deletions
|
@ -133,6 +133,27 @@ class ClassMapGeneratorTest extends \PHPUnit_Framework_TestCase
|
|||
$this->assertTrue(in_array($msg, $messages, true), $msg.' not found in expected messages ('.var_export($messages, true).')');
|
||||
}
|
||||
|
||||
/**
|
||||
* If one file has a class or interface defined more than once,
|
||||
* an ambiguous reference warning should not be produced
|
||||
*/
|
||||
public function testUnambiguousReference()
|
||||
{
|
||||
$this->checkIfFinderIsAvailable();
|
||||
|
||||
$finder = new Finder();
|
||||
$finder->files()->in(__DIR__ . '/Fixtures/Unambiguous');
|
||||
|
||||
$io = $this->getMockBuilder('Composer\IO\ConsoleIO')
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
|
||||
$io->expects($this->never())
|
||||
->method('write');
|
||||
|
||||
ClassMapGenerator::createMap($finder, null, $io);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage Could not scan for classes inside
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue