Exemplo n.º 1
0
 /**
  * @param \PHPUnit_Framework_MockObject_MockObject $mockObject
  * @param $methodName
  * @param ReturnValue|null $returnValue
  */
 public function setMockObjectExpectation(&$mockObject, $methodName, ReturnValue $returnValue = null)
 {
     if ($returnValue->isCallable()) {
         // callback
         $mockObject->expects($this->invokedRecorder)->method($methodName)->willReturnCallback($returnValue->getValue());
     } else {
         if ($returnValue->isSelf()) {
             // ->
             $mockObject->expects($this->invokedRecorder)->method($methodName)->willReturn($mockObject);
         } else {
             // value
             $mockObject->expects($this->invokedRecorder)->method($methodName)->willReturn($returnValue->getValue());
         }
     }
 }
 public function __willReturnCallable()
 {
     return $this->__returnValue->isCallable();
 }