spec\LdapTools\Object\LdapObjectManagerSpec::it_should_call_the_event_dispatcher_restore_events_when_restoring_an_object PHP Метод

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

public it_should_call_the_event_dispatcher_restore_events_when_restoring_an_object ( LdapTools\Event\EventDispatcherInterface $dispatcher, $connection )
$dispatcher LdapTools\Event\EventDispatcherInterface
    function it_should_call_the_event_dispatcher_restore_events_when_restoring_an_object(EventDispatcherInterface $dispatcher, $connection)
    {
        $dn = 'cn=foo\\0ADEL:0101011,cn=Deleted Objects,dc=example,dc=local';
        $ldapObject = new LdapObject(['dn' => $dn, 'lastKnownLocation' => 'cn=Users,dc=example,dc=local'], 'deleted');
        $beforeEvent = new LdapObjectRestoreEvent(Event::LDAP_OBJECT_BEFORE_RESTORE, $ldapObject, 'ou=employees,dc=foo,dc=bar');
        $afterEvent = new LdapObjectRestoreEvent(Event::LDAP_OBJECT_AFTER_RESTORE, $ldapObject, 'ou=employees,dc=foo,dc=bar');
        $connection->execute(Argument::type('\\LdapTools\\Operation\\BatchModifyOperation'))->willReturn(true);
        $dispatcher->dispatch($beforeEvent)->shouldBeCalled();
        $dispatcher->dispatch($afterEvent)->shouldBeCalled();
        $this->beConstructedWith($connection, $this->objectSchemaFactory, $dispatcher);
        $this->restore($ldapObject, 'ou=employees,dc=foo,dc=bar');
    }