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