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


PHP MethodProphecy::getObjectProphecy方法代码示例

本文整理汇总了PHP中Prophecy\Prophecy\MethodProphecy::getObjectProphecy方法的典型用法代码示例。如果您正苦于以下问题:PHP MethodProphecy::getObjectProphecy方法的具体用法?PHP MethodProphecy::getObjectProphecy怎么用?PHP MethodProphecy::getObjectProphecy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Prophecy\Prophecy\MethodProphecy的用法示例。


在下文中一共展示了MethodProphecy::getObjectProphecy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 /**
  * @param \Prophecy\Prophecy\ObjectProphecy    $object
  * @param \Prophecy\Prophecy\MethodProphecy    $method
  * @param \Prophecy\Argument\ArgumentsWildcard $arguments
  */
 function it_throws_NoCallsException_if_no_calls_found($object, $method, $arguments)
 {
     $method->getObjectProphecy()->willReturn($object);
     $method->getMethodName()->willReturn('getName');
     $method->getArgumentsWildcard()->willReturn($arguments);
     $arguments->__toString()->willReturn('123');
     $object->reveal()->willReturn(new \stdClass());
     $object->findProphecyMethodCalls('getName', Argument::any())->willReturn(array());
     $this->shouldThrow('Prophecy\\Exception\\Prediction\\NoCallsException')->duringCheck(array(), $object, $method);
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:15,代码来源:CallPredictionSpec.php

示例2:

 /**
  * @param \Prophecy\Prophecy\ObjectProphecy    $object
  * @param \Prophecy\Prophecy\MethodProphecy    $method
  * @param \Prophecy\Call\Call                  $call
  * @param \Prophecy\Argument\ArgumentsWildcard $arguments
  */
 function it_throws_UnexpectedCallsCountException_if_calls_found($object, $method, $call, $arguments)
 {
     $method->getObjectProphecy()->willReturn($object);
     $method->getMethodName()->willReturn('getName');
     $method->getArgumentsWildcard()->willReturn($arguments);
     $arguments->__toString()->willReturn('123');
     $call->getMethodName()->willReturn('getName');
     $call->getArguments()->willReturn(array(5, 4, 'three'));
     $call->getCallPlace()->willReturn('unknown');
     $this->shouldThrow('Prophecy\\Exception\\Prediction\\UnexpectedCallsCountException')->duringCheck(array($call), $object, $method);
 }
开发者ID:Ceciceciceci,项目名称:MySJSU-Class-Registration,代码行数:17,代码来源:CallTimesPredictionSpec.php

示例3: let

 /**
  * @param \Prophecy\Prophecy\ObjectProphecy $objectProphecy
  * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy
  * @param \Prophecy\Call\Call $call1
  * @param \Prophecy\Call\Call $call2
  */
 function let($objectProphecy, $methodProphecy, $call1, $call2)
 {
     $methodProphecy->getObjectProphecy()->willReturn($objectProphecy);
     $this->beConstructedWith('message', $methodProphecy, 5, array($call1, $call2));
 }
开发者ID:saj696,项目名称:pipe,代码行数:11,代码来源:UnexpectedCallsCountExceptionSpec.php

示例4:

 /**
  * @param \Prophecy\Prophecy\MethodProphecy $methodProphecy
  */
 function its_addMethodProphecy_throws_exception_when_method_has_no_ArgumentsWildcard($methodProphecy)
 {
     $methodProphecy->getArgumentsWildcard()->willReturn(null);
     $methodProphecy->getObjectProphecy()->willReturn($this);
     $methodProphecy->getMethodName()->willReturn('getTitle');
     $this->shouldThrow('Prophecy\\Exception\\Prophecy\\MethodProphecyException')->duringAddMethodProphecy($methodProphecy);
 }
开发者ID:burimshala,项目名称:numbertowords,代码行数:10,代码来源:ObjectProphecySpec.php

示例5: let

 function let(ObjectProphecy $objectProphecy, MethodProphecy $methodProphecy)
 {
     $methodProphecy->getObjectProphecy()->willReturn($objectProphecy);
     $this->beConstructedWith('message', $methodProphecy);
 }
开发者ID:phpspec,项目名称:prophecy,代码行数:5,代码来源:MethodProphecyExceptionSpec.php

示例6: __construct

 public function __construct($message, MethodProphecy $methodProphecy)
 {
     parent::__construct($message, $methodProphecy->getObjectProphecy());
     $this->methodProphecy = $methodProphecy;
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:5,代码来源:MethodProphecyException.php


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