本文整理匯總了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()));
}