Пример #1
0
 function it_proxies_method_calls_to_wrapped_object(\ArrayObject $obj, WrappedObject $wrappedObject, AccessInspector $accessInspector)
 {
     $obj->asort()->shouldBeCalled();
     $wrappedObject->isInstantiated()->willReturn(true);
     $wrappedObject->getInstance()->willReturn($obj);
     $accessInspector->isMethodCallable(Argument::type('ArrayObject'), 'asort')->willReturn(true);
     $this->call('asort');
 }
Пример #2
0
 /**
  * @param string $method
  *
  * @return bool
  */
 private function isObjectMethodCallable($method)
 {
     return $this->accessInspector->isMethodCallable($this->getWrappedObject(), $method);
 }
 function it_should_detect_a_method_if_there_is_no_magic_caller_but_wrapped_inspector_finds_one(AccessInspector $accessInspector)
 {
     $accessInspector->isMethodCallable(new \StdClass(), 'foo')->willReturn(true);
     $this->isMethodCallable(new \StdClass(), 'foo')->shouldReturn(true);
 }