spec\PhpSpec\Wrapper\Subject\CallerSpec::it_delegates_throwing_named_constructor_not_found_exception PHP Метод

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

public it_delegates_throwing_named_constructor_not_found_exception ( WrappedObject $wrappedObject, ExceptionFactory $exceptions )
$wrappedObject PhpSpec\Wrapper\Subject\WrappedObject
$exceptions PhpSpec\Exception\ExceptionFactory
    function it_delegates_throwing_named_constructor_not_found_exception(WrappedObject $wrappedObject, ExceptionFactory $exceptions)
    {
        $obj = new \ArrayObject();
        $arguments = array('firstname', 'lastname');
        $wrappedObject->isInstantiated()->willReturn(false);
        $wrappedObject->getInstance()->willReturn(null);
        $wrappedObject->getClassName()->willReturn('ArrayObject');
        $wrappedObject->getFactoryMethod()->willReturn('register');
        $wrappedObject->getArguments()->willReturn($arguments);
        $exceptions->namedConstructorNotFound('ArrayObject', 'register', $arguments)->willReturn(new \PhpSpec\Exception\Fracture\NamedConstructorNotFoundException('Named constructor "register" not found.', $obj, '"ArrayObject::register"', array()))->shouldBeCalled();
        $this->shouldThrow('\\PhpSpec\\Exception\\Fracture\\NamedConstructorNotFoundException')->duringCall('foo');
    }