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

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

public it_should_call_the_event_dispatcher_delete_events_when_deleting_an_object ( LdapTools\Event\EventDispatcherInterface $dispatcher, $connection )
$dispatcher LdapTools\Event\EventDispatcherInterface
    function it_should_call_the_event_dispatcher_delete_events_when_deleting_an_object(EventDispatcherInterface $dispatcher, $connection)
    {
        $ldapObject = new LdapObject(['dn' => 'cn=foo,dc=foo,dc=bar'], 'user');
        $beforeEvent = new LdapObjectEvent(Event::LDAP_OBJECT_BEFORE_DELETE, $ldapObject);
        $afterEvent = new LdapObjectEvent(Event::LDAP_OBJECT_AFTER_DELETE, $ldapObject);
        $connection->execute(new DeleteOperation('cn=foo,dc=foo,dc=bar'))->willReturn(true);
        $dispatcher->dispatch($beforeEvent)->shouldBeCalled();
        $dispatcher->dispatch($afterEvent)->shouldBeCalled();
        $this->beConstructedWith($connection, $this->objectSchemaFactory, $dispatcher);
        $this->delete($ldapObject);
    }