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

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

public it_should_reconnect_a_connection_that_has_been_idle_too_long ( OperationHandler $handler, $connection, $dispatcher )
$handler LdapTools\Operation\Handler\OperationHandler
    function it_should_reconnect_a_connection_that_has_been_idle_too_long(OperationHandler $handler, $connection, $dispatcher)
    {
        $operation = (new DeleteOperation('foo'))->setServer('foo');
        $handler->supports($operation)->willReturn(true);
        $handler->setConnection($connection)->shouldBeCalled();
        $handler->setEventDispatcher($dispatcher)->shouldBeCalled();
        $handler->setOperationDefaults($operation)->shouldBeCalled();
        $handler->execute($operation)->shouldBeCalled();
        $connection->getIdleTime()->willReturn(600);
        $connection->close()->shouldBeCalled()->willReturn($connection);
        $connection->connect()->shouldBeCalled();
        $this->addHandler($handler);
        $this->execute($operation);
    }