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


PHP ReflectionClass::expects方法代码示例

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

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


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