spec\LdapTools\Operation\Invoker\LdapOperationInvokerSpec::it_should_connect_if_not_yet_bound_on_execution PHP Метод

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

public it_should_connect_if_not_yet_bound_on_execution ( OperationHandler $handler, $dispatcher, $connection )
$handler LdapTools\Operation\Handler\OperationHandler
    function it_should_connect_if_not_yet_bound_on_execution(OperationHandler $handler, $dispatcher, $connection)
    {
        $operation = new DeleteOperation('foo');
        $handler->supports($operation)->willReturn(true);
        $handler->setConnection($connection)->shouldBeCalled();
        $handler->setEventDispatcher($dispatcher)->shouldBeCalled();
        $handler->setOperationDefaults($operation)->shouldBeCalled();
        $handler->execute($operation)->shouldBeCalled();
        $connection->getServer()->willReturn(null);
        $connection->isBound()->willReturn(false);
        $connection->getIdleTime()->willReturn(1);
        $connection->close()->shouldNotBeCalled();
        $connection->connect()->shouldBeCalled();
        $this->addHandler($handler);
        $this->execute($operation);
    }