You are here

public function DriverChainTest::testDefaultDriverGetAllClassNames in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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

DriverChainTest

Namespace

Doctrine\Tests\Common\Persistence\Mapping

Code

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);
}