methodNotFound() public method

public methodNotFound ( string $classname, string $method, array $arguments = [] ) : Fracture\MethodNotFoundException
$classname string
$method string
$arguments array
return Fracture\MethodNotFoundException
Esempio n. 1
0
 /**
  * @param string $method
  * @param  array                                                                                                     $arguments
  * @return \PhpSpec\Exception\Fracture\MethodNotFoundException|\PhpSpec\Exception\Fracture\MethodNotVisibleException
  */
 private function methodNotFound($method, array $arguments = array())
 {
     $className = $this->wrappedObject->getClassName();
     if (!method_exists($className, $method)) {
         return $this->exceptionFactory->methodNotFound($className, $method, $arguments);
     }
     return $this->exceptionFactory->methodNotVisible($className, $method, $arguments);
 }
Esempio n. 2
0
 function it_delegates_throwing_method_not_found_exception_for_constructor(WrappedObject $wrappedObject, ExceptionFactory $exceptions, \stdClass $argument)
 {
     $obj = new ExampleClass();
     $wrappedObject->isInstantiated()->willReturn(false);
     $wrappedObject->getInstance()->willReturn(null);
     $wrappedObject->getArguments()->willReturn(array($argument));
     $wrappedObject->getClassName()->willReturn('spec\\PhpSpec\\Wrapper\\Subject\\ExampleClass');
     $exceptions->methodNotFound('spec\\PhpSpec\\Wrapper\\Subject\\ExampleClass', '__construct', array($argument))->willReturn(new \PhpSpec\Exception\Fracture\MethodNotFoundException('Method "__construct" not found.', $obj, '"ExampleClass::__construct"', array()))->shouldBeCalled();
     $this->shouldThrow('\\PhpSpec\\Exception\\Fracture\\MethodNotFoundException')->duringCall('__construct');
 }