本文整理匯總了PHP中Doctrine\ORM\Mapping\ClassMetadataInfo::expects方法的典型用法代碼示例。如果您正苦於以下問題:PHP ClassMetadataInfo::expects方法的具體用法?PHP ClassMetadataInfo::expects怎麽用?PHP ClassMetadataInfo::expects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doctrine\ORM\Mapping\ClassMetadataInfo
的用法示例。
在下文中一共展示了ClassMetadataInfo::expects方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testAddedOptions
public function testAddedOptions()
{
$this->metadata->expects($this->once())->method('getTableName')->will($this->returnValue(IndexText::TABLE_NAME));
$this->event->expects($this->once())->method('getClassMetadata')->will($this->returnValue($this->metadata));
$this->listener->loadClassMetadata($this->event);
$this->assertEquals(['options' => ['engine' => PdoMysql::ENGINE_MYISAM], 'indexes' => ['value' => ['columns' => ['value']]]], $this->metadata->table);
}
示例2: setUp
protected function setUp()
{
$this->classMetadata = $this->getMockBuilder('Doctrine\\ORM\\Mapping\\ClassMetadataInfo')->disableOriginalConstructor()->setMethods(array('getSingleIdentifierFieldName'))->getMock();
$this->classMetadata->expects($this->any())->method('getSingleIdentifierFieldName')->will($this->returnValue(self::TEST_IDENTIFIER));
$this->ormConfiguration = $this->getMockBuilder('Doctrine\\ORM\\Configuration')->disableOriginalConstructor()->setMethods(array('addCustomHydrationMode'))->getMock();
$this->entityManager = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')->disableOriginalConstructor()->setMethods(array('getClassMetadata', 'getConfiguration'))->getMock();
$this->entityManager->expects($this->any())->method('getClassMetadata')->with(self::TEST_CLASS)->will($this->returnValue($this->classMetadata));
$this->entityManager->expects($this->any())->method('getConfiguration')->will($this->returnValue($this->ormConfiguration));
$this->registry = $this->getMockBuilder('Doctrine\\Common\\Persistence\\ManagerRegistry')->disableOriginalConstructor()->setMethods('getManager', 'getRepository')->getMockForAbstractClass();
$this->registry->expects($this->any())->method('getManager')->will($this->returnValue($this->entityManager));
$this->registry->expects($this->any())->method('getRepository')->with(self::TEST_CLASS)->will($this->returnValue($this->getEntityRepository()));
$this->type = new TranslatableEntityType($this->registry);
}
示例3: test_a_custom_strategy_with_the_implementation_can_be_set_afterwards
public function test_a_custom_strategy_with_the_implementation_can_be_set_afterwards()
{
$this->field->expects($this->once())->method('generatedValue')->with('CUSTOM');
$this->cm->expects($this->once())->method('setCustomGeneratorDefinition')->with(['class' => 'A\\Class\\Implementing\\AbstractIdGenerator']);
$this->fluent->custom('A\\Class\\Implementing\\AbstractIdGenerator')->build();
}