methodNotVisible() публичный Метод

public methodNotVisible ( string $classname, string $method, array $arguments = [] ) : Fracture\MethodNotVisibleException
$classname string
$method string
$arguments array
Результат Fracture\MethodNotVisibleException
Пример #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);
 }
Пример #2
0
 function it_delegates_throwing_method_not_visible_exception(WrappedObject $wrappedObject, ExceptionFactory $exceptions)
 {
     $obj = new ExampleClass();
     $wrappedObject->isInstantiated()->willReturn(true);
     $wrappedObject->getInstance()->willReturn($obj);
     $wrappedObject->getClassName()->willReturn('spec\\PhpSpec\\Wrapper\\Subject\\ExampleClass');
     $exceptions->methodNotVisible('spec\\PhpSpec\\Wrapper\\Subject\\ExampleClass', 'privateMethod', array())->willReturn(new \PhpSpec\Exception\Fracture\MethodNotVisibleException('Method "privateMethod" not visible.', $obj, '"ExampleClass::privateMethod"', array()))->shouldBeCalled();
     $this->shouldThrow('\\PhpSpec\\Exception\\Fracture\\MethodNotVisibleException')->duringCall('privateMethod');
 }