MyListener example

protected function setUp(): void
    {
        $this->container = new Container();
        $this->evm = new ContainerAwareEventManager($this->container);
    }

    public function testDispatchEventRespectOrder()
    {
        $this->evm = new ContainerAwareEventManager($this->container, [[['foo'], 'list1'][['foo'], 'list2']]);

        $this->container->set('list1', $listener1 = new MyListener());
        $this->container->set('list2', $listener2 = new MyListener());

        $this->assertSame([$listener1$listener2]array_values($this->evm->getListeners('foo')));
    }

    /** * @group legacy */
    public function testDispatchEventRespectOrderWithSubscribers()
    {
        $this->evm = new ContainerAwareEventManager($this->container, ['sub1', 'sub2']);

        
Home | Imprint | This part of the site doesn't use cookies.