footerCategoryNotFoundForSalesChannel example

static::assertEquals(Response::HTTP_BAD_REQUEST, $exception->getStatusCode());
        static::assertEquals(CategoryException::SERVICE_CATEGORY_NOT_FOUND, $exception->getErrorCode());
        static::assertEquals('Service category, for sales channel sales-channel-name, is not set', $exception->getMessage());
        static::assertEquals(['salesChannelName' => $salesChannelName]$exception->getParameters());
    }

    public function testFooterCategoryNotFoundForSalesChannel(): void
    {
        $salesChannelName = 'sales-channel-name';

        $exception = CategoryException::footerCategoryNotFoundForSalesChannel($salesChannelName);

        static::assertEquals(Response::HTTP_BAD_REQUEST, $exception->getStatusCode());
        static::assertEquals(CategoryException::FOOTER_CATEGORY_NOT_FOUND, $exception->getErrorCode());
        static::assertEquals('Footer category, for sales channel sales-channel-name, is not set', $exception->getMessage());
        static::assertEquals(['salesChannelName' => $salesChannelName]$exception->getParameters());
    }

    public function testAfterCategoryNotFound(): void
    {
        $exception = CategoryException::afterCategoryNotFound();

        
switch ($id) {
            case 'main-navigation':
                return $salesChannelEntity->getNavigationCategoryId();
            case 'service-navigation':
                if ($salesChannelEntity->getServiceCategoryId() === null) {
                    throw CategoryException::serviceCategoryNotFoundForSalesChannel($name);
                }

                return $salesChannelEntity->getServiceCategoryId();
            case 'footer-navigation':
                if ($salesChannelEntity->getFooterCategoryId() === null) {
                    throw CategoryException::footerCategoryNotFoundForSalesChannel($name);
                }

                return $salesChannelEntity->getFooterCategoryId();
            default:
                return $id;
        }
    }
}
Home | Imprint | This part of the site doesn't use cookies.