當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。