public function DriverChainTest::testDefaultDriverGetAllClassNames in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/doctrine/common/tests/Doctrine/Tests/Common/Persistence/Mapping/ChainDriverTest.php \Doctrine\Tests\Common\Persistence\Mapping\DriverChainTest::testDefaultDriverGetAllClassNames()
File
- vendor/
doctrine/ common/ tests/ Doctrine/ Tests/ Common/ Persistence/ Mapping/ ChainDriverTest.php, line 126
Class
Namespace
Doctrine\Tests\Common\Persistence\MappingCode
public function testDefaultDriverGetAllClassNames() {
$companyDriver = $this
->getMock('Doctrine\\Common\\Persistence\\Mapping\\Driver\\MappingDriver');
$defaultDriver = $this
->getMock('Doctrine\\Common\\Persistence\\Mapping\\Driver\\MappingDriver');
$chain = new MappingDriverChain();
$companyDriver
->expects($this
->once())
->method('getAllClassNames')
->will($this
->returnValue(array(
'Doctrine\\Tests\\Models\\Company\\Foo',
)));
$defaultDriver
->expects($this
->once())
->method('getAllClassNames')
->will($this
->returnValue(array(
'Other\\Class',
)));
$chain
->setDefaultDriver($defaultDriver);
$chain
->addDriver($companyDriver, 'Doctrine\\Tests\\Models\\Company');
$classNames = $chain
->getAllClassNames();
$this
->assertEquals(array(
'Doctrine\\Tests\\Models\\Company\\Foo',
'Other\\Class',
), $classNames);
}