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

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

public it_should_execute_all_child_operations ( $connection, $dispatcher, OperationHandler $handler, DeleteOperation $operation, AddOperation $preOperation, AddOperation $postOperation )
$handler LdapTools\Operation\Handler\OperationHandler
$operation LdapTools\Operation\DeleteOperation
$preOperation LdapTools\Operation\AddOperation
$postOperation LdapTools\Operation\AddOperation
    function it_should_execute_all_child_operations($connection, $dispatcher, OperationHandler $handler, DeleteOperation $operation, AddOperation $preOperation, AddOperation $postOperation)
    {
        $handler->supports($operation)->willReturn(true);
        $handler->supports($preOperation)->willReturn(true);
        $handler->supports($postOperation)->willReturn(true);
        $handler->setConnection($connection)->shouldBeCalled();
        $handler->setEventDispatcher($dispatcher)->shouldBeCalled();
        $handler->setOperationDefaults($operation)->shouldBeCalled();
        $handler->setOperationDefaults($preOperation)->shouldBeCalled();
        $handler->setOperationDefaults($postOperation)->shouldBeCalled();
        $handler->execute($operation)->shouldBeCalled();
        $handler->execute($preOperation)->shouldBeCalled();
        $handler->execute($postOperation)->shouldBeCalled();
        $operation->getServer()->willReturn('foo');
        $operation->getControls()->willReturn([]);
        $operation->getPreOperations()->willReturn([$preOperation]);
        $operation->getPostOperations()->willReturn([$postOperation]);
        foreach ([$preOperation, $postOperation] as $op) {
            $op->getServer()->willReturn('foo');
            $op->getControls()->willReturn([]);
            $op->getPreOperations()->willReturn([]);
            $op->getPostOperations()->willReturn([]);
        }
        $this->addHandler($handler);
        $this->execute($operation);
    }