本文整理汇总了PHP中ReflectionClass::expects方法的典型用法代码示例。如果您正苦于以下问题:PHP ReflectionClass::expects方法的具体用法?PHP ReflectionClass::expects怎么用?PHP ReflectionClass::expects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReflectionClass
的用法示例。
在下文中一共展示了ReflectionClass::expects方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: testCombinationServers
/**
* Testing specific server scenario configured in Job annotations as a simple server
*/
public function testCombinationServers()
{
$this->reflectionClass->expects($this->once())->method('getNamespaceName')->will($this->returnValue($this->classNamespace));
$this->reflectionClass->expects($this->exactly(2))->method('getName')->will($this->returnValue($this->className));
$this->reflectionClass->expects($this->once())->method('getFileName')->will($this->returnValue($this->fileName));
$this->reflectionClass->expects($this->once())->method('getMethods')->will($this->returnValue(array()));
$this->reader->expects($this->never())->method('getMethodAnnotations');
$this->workAnnotation->servers = array('host' => '10.0.0.2', 'port' => '80');
$workerClass = new WorkerClass($this->workAnnotation, $this->reflectionClass, $this->reader, $this->servers, $this->defaultSettings);
$this->assertEquals($workerClass->toArray(), array('namespace' => $this->classNamespace, 'className' => $this->className, 'fileName' => $this->fileName, 'callableName' => $this->className, 'description' => $workerClass::DEFAULT_DESCRIPTION, 'service' => null, 'servers' => array($this->workAnnotation->servers), 'iterations' => $this->defaultSettings['iterations'], 'minimumExecutionTime' => $this->defaultSettings['minimum_execution_time'], 'timeout' => $this->defaultSettings['timeout'], 'jobs' => array()));
}