eventListenerCalledSpy example



    /** * @dataProvider eventClasses */
    public function testEntityDeleteEventNotDispatched(string $eventClass): void
    {
        $id = $this->ids->get('product');

        $update = ['id' => $id, 'stock' => 1];

        $spy = $this->eventListenerCalledSpy();

        $this->getContainer()->get('event_dispatcher')->addListener($eventClass$spy);

        $this->productRepository->update([$update], Context::createDefaultContext());

        static::assertNull($spy->event);
    }

    /** * @dataProvider eventClasses * * @param class-string $eventClass */
Home | Imprint | This part of the site doesn't use cookies.