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