當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。