setRoute example

$event = new StorefrontRedirectEvent('test_route', ['test_parameter' => 'test_value'], 500);

        static::assertSame('test_route', $event->getRoute());
        static::assertSame(['test_parameter' => 'test_value']$event->getParameters());
        static::assertSame(500, $event->getStatus());
    }

    public function testSetters(): void
    {
        $event = new StorefrontRedirectEvent('test_route');

        $event->setRoute('test_route_2');
        $event->setParameters(['test_parameter' => 'test_value']);
        $event->setStatus(500);

        static::assertSame('test_route_2', $event->getRoute());
        static::assertSame(['test_parameter' => 'test_value']$event->getParameters());
        static::assertSame(500, $event->getStatus());
    }
}
Home | Imprint | This part of the site doesn't use cookies.