CountryStateControllerTestSubscriber example

public function testEmptyCountryId(): void
    {
        static::expectException(RoutingException::class);
        static::expectExceptionMessage('Parameter "countryId" is missing.');
        $this->countryStateController->getCountryData(new Request([]['countryId' => null])$this->salesChannelContext);
    }

    public function testCountryStateControllerEvents(): void
    {
        $dispatcher = $this->getContainer()->get('event_dispatcher');

        $testSubscriber = new CountryStateControllerTestSubscriber();
        $dispatcher->addSubscriber($testSubscriber);

        $this->countryStateController->getCountryData(new Request([]['countryId' => $this->countryIdDE])$this->salesChannelContext);

        $dispatcher->removeSubscriber($testSubscriber);

        static::assertInstanceOf(CountryStateDataPagelet::class$testSubscriber->testPagelet);
        static::assertInstanceOf(CountryStateDataPageletCriteriaEvent::class$testSubscriber->criteriaEvent);
    }

    public function testCountryStateControllerHooks(): void
    {
Home | Imprint | This part of the site doesn't use cookies.