本文整理汇总了PHP中Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider::getClassName方法的典型用法代码示例。如果您正苦于以下问题:PHP ConfigProvider::getClassName方法的具体用法?PHP ConfigProvider::getClassName怎么用?PHP ConfigProvider::getClassName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Oro\Bundle\EntityConfigBundle\Provider\ConfigProvider
的用法示例。
在下文中一共展示了ConfigProvider::getClassName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetClassName
public function testGetClassName()
{
$this->assertEquals(DemoEntity::ENTITY_NAME, $this->configProvider->getClassName(DemoEntity::ENTITY_NAME));
$className = DemoEntity::ENTITY_NAME;
$demoEntity = new $className();
$this->assertEquals(DemoEntity::ENTITY_NAME, $this->configProvider->getClassName($demoEntity));
$this->assertEquals(DemoEntity::ENTITY_NAME, $this->configProvider->getClassName(array($demoEntity)));
$classMetadata = $this->getMockBuilder('Doctrine\\ORM\\Mapping\\ClassMetadata')->disableOriginalConstructor()->getMock();
$classMetadata->expects($this->once())->method('getName')->will($this->returnValue(DemoEntity::ENTITY_NAME));
$connectionMock = new ConnectionMock(array(), new DriverMock());
$emMock = EntityManagerMock::create($connectionMock);
$persistentCollection = new PersistentCollection($emMock, $classMetadata, new ArrayCollection());
$this->assertEquals(DemoEntity::ENTITY_NAME, $this->configProvider->getClassName($persistentCollection));
$this->setExpectedException('Oro\\Bundle\\EntityConfigBundle\\Exception\\RuntimeException');
$this->assertEquals(DemoEntity::ENTITY_NAME, $this->configProvider->getClassName(array()));
}