setUpdatedStates example

public function testProductStatesBeforeChangeEvent(): void
    {
        $updatedStates = [new UpdatedStates('foobar', ['foo']['bar'])];
        $context = Context::createDefaultContext();

        $event = new ProductStatesBeforeChangeEvent($updatedStates$context);

        static::assertEquals($updatedStates$event->getUpdatedStates());
        static::assertEquals($context$event->getContext());

        $updatedStates = [new UpdatedStates('foobar', ['foo']['baz'])];
        $event->setUpdatedStates($updatedStates);

        static::assertEquals($updatedStates$event->getUpdatedStates());
    }
}
Home | Imprint | This part of the site doesn't use cookies.