当前位置: 首页>>代码示例>>PHP>>正文


PHP ClassMetadataInfo::expects方法代码示例

本文整理汇总了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);
 }
开发者ID:Maksold,项目名称:platform,代码行数:7,代码来源:FulltextIndexListenerTest.php

示例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);
 }
开发者ID:aml-bendall,项目名称:ExpandAkeneoApi,代码行数:13,代码来源:TranslatableEntityTypeTest.php

示例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();
 }
开发者ID:guiwoda,项目名称:fluent,代码行数:6,代码来源:GeneratedValueTest.php


注:本文中的Doctrine\ORM\Mapping\ClassMetadataInfo::expects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。