當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Reader::expects方法代碼示例

本文整理匯總了PHP中Doctrine\Common\Annotations\Reader::expects方法的典型用法代碼示例。如果您正苦於以下問題:PHP Reader::expects方法的具體用法?PHP Reader::expects怎麽用?PHP Reader::expects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\Common\Annotations\Reader的用法示例。


在下文中一共展示了Reader::expects方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testLoadMetadataForClassAddValuesToMetadata

 /**
  * @expectedException \Doctrine\Search\Exception\Driver\PropertyDoesNotExistsInMetadataException
  */
 public function testLoadMetadataForClassAddValuesToMetadata()
 {
     $this->reflectionClass->expects($this->once())->method('getProperties')->will($this->returnValue(array()));
     $this->reader->expects($this->once())->method('getClassAnnotations')->will($this->returnValue(array(0, new TestSearchable(array()))));
     $this->classMetadata->expects($this->once())->method('getReflectionClass')->will($this->returnValue($this->reflectionClass));
     $this->annotationDriver->loadMetadataForClass('Doctrine\\Tests\\Models\\Blog\\BlogPost', $this->classMetadata);
 }
開發者ID:akleiber,項目名稱:search,代碼行數:10,代碼來源:AnnotationDriverTest.php

示例2: setUp

 public function setUp()
 {
     $this->reflectionService = $this->getAccessibleMock(\TYPO3\Flow\Reflection\ReflectionService::class, null);
     $this->mockAnnotationReader = $this->getMockBuilder(\Doctrine\Common\Annotations\Reader::class)->disableOriginalConstructor()->getMock();
     $this->mockAnnotationReader->expects($this->any())->method('getClassAnnotations')->will($this->returnValue(array()));
     $this->inject($this->reflectionService, 'annotationReader', $this->mockAnnotationReader);
 }
開發者ID:kszyma,項目名稱:flow-development-collection,代碼行數:7,代碼來源:ReflectionServiceTest.php

示例3: testGetGeographicalQueryAnnotation

 /**
  * Test the getGeographicalQueryAnnotation method of the AnnotationDriver.
  */
 public function testGetGeographicalQueryAnnotation()
 {
     $this->geographicalQueryAnnotation->expects($this->once())->method('getMethod')->will($this->returnValue('getAddress'));
     $this->reader->expects($this->once())->method('getMethodAnnotation')->with($this->isInstanceOf('\\ReflectionMethod'), $this->equalTo('Vich\\GeographicalBundle\\Annotation\\GeographicalQuery'))->will($this->returnValue($this->geographicalQueryAnnotation));
     $annot = $this->driver->getGeographicalQueryAnnotation($this->geographicalEntity);
     $this->assertNotNull($annot);
     $this->assertEquals('getAddress', $annot->getMethod());
 }
開發者ID:nightchiller,項目名稱:GeographicalBundle,代碼行數:11,代碼來源:AnnotationDriverTest.php


注:本文中的Doctrine\Common\Annotations\Reader::expects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。