From 9007898c08da965c1e163209244f219af2ee6e95 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Thu, 18 Jul 2019 14:04:41 +0200 Subject: [PATCH 1/2] [Product] Remove channel code from product routes --- UPGRADE.md | 10 +++- doc/swagger.yml | 54 +++++++++++++------ .../Product/AddReviewByCodeAction.php | 11 +++- .../Product/AddReviewBySlugAction.php | 11 +++- .../Product/ShowLatestProductAction.php | 15 +++++- .../ShowProductCatalogByTaxonCodeAction.php | 15 +++++- .../ShowProductCatalogByTaxonSlugAction.php | 15 +++++- .../ShowProductDetailsByCodeAction.php | 15 +++++- .../ShowProductDetailsBySlugAction.php | 15 +++++- .../ShowProductReviewsByCodeAction.php | 12 ++++- .../ShowProductReviewsBySlugAction.php | 12 ++++- .../Product/AddProductReviewByCodeRequest.php | 15 ++++-- .../Product/AddProductReviewBySlugRequest.php | 15 ++++-- src/Resources/config/routing.yml | 6 +-- .../config/serializer/Product/ProductView.yml | 1 - .../config/services/actions/product.xml | 10 ++++ .../Product/ProductCatalogViewRepository.php | 2 - .../Product/ProductReviewsViewRepository.php | 2 - .../Product/ProductAddReviewByCodeApiTest.php | 30 ++--------- .../Product/ProductAddReviewBySlugApiTest.php | 30 ++--------- .../ProductShowCatalogByCodeApiTest.php | 21 ++------ .../ProductShowCatalogBySlugApiTest.php | 25 +++------ .../ProductShowDetailsByCodeApiTest.php | 27 +++------- .../ProductShowDetailsBySlugApiTest.php | 29 +++------- .../Product/ProductShowLatestApiTest.php | 18 +------ .../ProductShowReviewsByCodeApiTest.php | 15 +----- .../ProductShowReviewsBySlugApiTest.php | 15 +----- .../channel_has_not_been_found_response.json | 2 +- ...an_product_list_page_by_code_response.json | 16 +++--- ...an_product_list_page_by_slug_response.json | 16 +++--- ...man_product_with_options_details_page.json | 6 +-- .../german_simple_product_details_page.json | 2 +- ...ed_product_list_page_by_code_response.json | 10 ++-- ...ed_product_list_page_by_slug_response.json | 10 ++-- .../product_list_latest_2_response.json | 8 +-- .../product_list_latest_4_response.json | 12 ++--- .../product_list_page_by_code_response.json | 18 +++---- .../product_list_page_by_slug_response.json | 18 +++---- ...uct_review_list_page_by_code_response.json | 8 +-- ...uct_review_list_page_by_slug_response.json | 8 +-- ...ct_t_shirt_list_page_by_code_response.json | 10 ++-- ...ct_t_shirt_list_page_by_slug_response.json | 10 ++-- .../product_with_options_details_page.json | 6 +-- .../product_with_variant_details_page.json | 2 +- .../product_without_taxons_details_page.json | 2 +- .../product/simple_product_details_page.json | 2 +- 46 files changed, 304 insertions(+), 308 deletions(-) diff --git a/UPGRADE.md b/UPGRADE.md index 8f3498fe5..b9b689da9 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -27,9 +27,15 @@ | Old Route | New route | |:--------------------------------------|:---------------------------------------| - | `{channelCode}/address-book/*` | `address-book/*` | + | `{channelCode}/address-book/*` | `address-book/*` | | `{channelCode}/checkout/*` | `checkout/*` | - | `{channelCode}/orders/*` | `orders/*` | + | `{channelCode}/orders/*` | `orders/*` | + | `{channelCode}/products/*` | `products/*` | + | `{channelCode}/product-latest` | `product-latest` | + | `{channelCode}/taxon-products/*` | `taxon-products/*` | + +* The channel code has been added as a second argument to `AddProductReviewByCodeRequest` +and `AddProductReviewBySlugRequest` classes. # UPGRADE FROM 1.0.0-beta.17 to 1.0.0-beta.18 diff --git a/doc/swagger.yml b/doc/swagger.yml index bb1a6590a..dea8408c6 100644 --- a/doc/swagger.yml +++ b/doc/swagger.yml @@ -440,9 +440,7 @@ paths: - {} - bearerAuth: [] - /{channelCode}/taxon-products/by-slug/{taxonSlug}: - parameters: - - $ref: "#/parameters/ChannelCode" + /taxon-products/by-slug/{taxonSlug}: get: tags: - "products" @@ -475,9 +473,8 @@ paths: description: "Paginated product list." schema: $ref: "#/definitions/ProductsPage" - /{channelCode}/taxon-products/by-code/{taxonCode}: - parameters: - - $ref: "#/parameters/ChannelCode" + + /taxon-products/by-code/{taxonCode}: get: tags: - "products" @@ -510,9 +507,8 @@ paths: description: "Paginated product list." schema: $ref: "#/definitions/ProductsPage" - /{channelCode}/products/by-slug/{slug}: - parameters: - - $ref: "#/parameters/ChannelCode" + + /products/by-slug/{slug}: get: tags: - "products" @@ -535,9 +531,8 @@ paths: description: "Show a product with the given slug." schema: $ref: "#/definitions/ProductDetails" - /{channelCode}/products/by-code/{code}: - parameters: - - $ref: "#/parameters/ChannelCode" + + /products/by-code/{code}: get: tags: - "products" @@ -560,9 +555,9 @@ paths: description: "Show a product with the given code." schema: $ref: "#/definitions/ProductDetails" - /{channelCode}/products/by-slug/{slug}/reviews: + + /products/by-slug/{slug}/reviews: parameters: - - $ref: "#/parameters/ChannelCode" - name: "slug" in: "path" description: "Slug of expected product." @@ -598,9 +593,9 @@ paths: description: "A paginated list of all reviews related to the product identified by slug." schema: $ref: "#/definitions/ProductReviewsPage" - /{channelCode}/product/by-code/{code}/reviews: + + /products/by-code/{code}/reviews: parameters: - - $ref: "#/parameters/ChannelCode" - name: "code" in: "path" description: "Code of expected product." @@ -636,6 +631,33 @@ paths: description: "A paginated list of all reviews related to the product identified by slug." schema: $ref: "#/definitions/ProductReviewsPage" + + /product-latest: + get: + tags: + - "products" + summary: "Show latest products." + description: "This endpoint will return an array of latest products." + operationId: "latestProducts" + parameters: + - name: "locale" + in: "query" + description: "Locale in which products should be shown." + required: false + type: "string" + - name: "limit" + in: "query" + description: "Number of expected products per page." + required: false + type: "integer" + responses: + 200: + description: "Array of latest products." + schema: + type: "array" + items: + $ref: "#/definitions/Product" + /{channelCode}/taxons: parameters: - $ref: "#/parameters/ChannelCode" diff --git a/src/Controller/Product/AddReviewByCodeAction.php b/src/Controller/Product/AddReviewByCodeAction.php index 1d720f321..735aa722b 100644 --- a/src/Controller/Product/AddReviewByCodeAction.php +++ b/src/Controller/Product/AddReviewByCodeAction.php @@ -6,6 +6,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; use Sylius\ShopApiPlugin\Factory\ValidationErrorViewFactoryInterface; use Sylius\ShopApiPlugin\Request\Product\AddProductReviewByCodeRequest; use Symfony\Component\HttpFoundation\Request; @@ -27,21 +28,27 @@ final class AddReviewByCodeAction /** @var ValidationErrorViewFactoryInterface */ private $validationErrorViewFactory; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ViewHandlerInterface $viewHandler, MessageBusInterface $bus, ValidatorInterface $validator, - ValidationErrorViewFactoryInterface $validationErrorViewFactory + ValidationErrorViewFactoryInterface $validationErrorViewFactory, + ChannelContextInterface $channelContext ) { $this->viewHandler = $viewHandler; $this->bus = $bus; $this->validator = $validator; $this->validationErrorViewFactory = $validationErrorViewFactory; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { - $addReviewRequest = new AddProductReviewByCodeRequest($request); + $channel = $this->channelContext->getChannel(); + $addReviewRequest = new AddProductReviewByCodeRequest($request, $channel->getCode()); $validationResults = $this->validator->validate($addReviewRequest); diff --git a/src/Controller/Product/AddReviewBySlugAction.php b/src/Controller/Product/AddReviewBySlugAction.php index cb01c60f4..348a1b3b4 100644 --- a/src/Controller/Product/AddReviewBySlugAction.php +++ b/src/Controller/Product/AddReviewBySlugAction.php @@ -6,6 +6,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; use Sylius\ShopApiPlugin\Factory\ValidationErrorViewFactoryInterface; use Sylius\ShopApiPlugin\Request\Product\AddProductReviewBySlugRequest; use Symfony\Component\HttpFoundation\Request; @@ -27,21 +28,27 @@ final class AddReviewBySlugAction /** @var ValidationErrorViewFactoryInterface */ private $validationErrorViewFactory; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ViewHandlerInterface $viewHandler, MessageBusInterface $bus, ValidatorInterface $validator, - ValidationErrorViewFactoryInterface $validationErrorViewFactory + ValidationErrorViewFactoryInterface $validationErrorViewFactory, + ChannelContextInterface $channelContext ) { $this->viewHandler = $viewHandler; $this->bus = $bus; $this->validator = $validator; $this->validationErrorViewFactory = $validationErrorViewFactory; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { - $addReviewRequest = new AddProductReviewBySlugRequest($request); + $channel = $this->channelContext->getChannel(); + $addReviewRequest = new AddProductReviewBySlugRequest($request, $channel->getCode()); $validationResults = $this->validator->validate($addReviewRequest); diff --git a/src/Controller/Product/ShowLatestProductAction.php b/src/Controller/Product/ShowLatestProductAction.php index 94aabe0f8..311d1d983 100644 --- a/src/Controller/Product/ShowLatestProductAction.php +++ b/src/Controller/Product/ShowLatestProductAction.php @@ -6,6 +6,8 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; +use Sylius\Component\Channel\Context\ChannelNotFoundException; use Sylius\ShopApiPlugin\ViewRepository\Product\ProductLatestViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -19,22 +21,31 @@ final class ShowLatestProductAction /** @var ProductLatestViewRepositoryInterface */ private $productLatestQuery; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ViewHandlerInterface $viewHandler, - ProductLatestViewRepositoryInterface $productLatestQuery + ProductLatestViewRepositoryInterface $productLatestQuery, + ChannelContextInterface $channelContext ) { $this->viewHandler = $viewHandler; $this->productLatestQuery = $productLatestQuery; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { try { + $channel = $this->channelContext->getChannel(); + return $this->viewHandler->handle(View::create($this->productLatestQuery->getLatestProducts( - $request->attributes->get('channelCode'), + $channel->getCode(), $request->query->get('locale'), $request->query->getInt('limit', 4) ), Response::HTTP_OK)); + } catch (ChannelNotFoundException $exception) { + throw new NotFoundHttpException('Channel has not been found.'); } catch (\InvalidArgumentException $exception) { throw new NotFoundHttpException($exception->getMessage()); } diff --git a/src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php b/src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php index 678fbc574..8585f7937 100644 --- a/src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php +++ b/src/Controller/Product/ShowProductCatalogByTaxonCodeAction.php @@ -6,6 +6,8 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; +use Sylius\Component\Channel\Context\ChannelNotFoundException; use Sylius\ShopApiPlugin\Model\PaginatorDetails; use Sylius\ShopApiPlugin\ViewRepository\Product\ProductCatalogViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; @@ -20,23 +22,32 @@ final class ShowProductCatalogByTaxonCodeAction /** @var ProductCatalogViewRepositoryInterface */ private $productCatalogQuery; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ViewHandlerInterface $viewHandler, - ProductCatalogViewRepositoryInterface $productCatalogQuery + ProductCatalogViewRepositoryInterface $productCatalogQuery, + ChannelContextInterface $channelContext ) { $this->viewHandler = $viewHandler; $this->productCatalogQuery = $productCatalogQuery; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { try { + $channel = $this->channelContext->getChannel(); + return $this->viewHandler->handle(View::create($this->productCatalogQuery->findByTaxonCode( $request->attributes->get('taxonCode'), - $request->attributes->get('channelCode'), + $channel->getCode(), new PaginatorDetails($request->attributes->get('_route'), $request->query->all()), $request->query->get('locale') ), Response::HTTP_OK)); + } catch (ChannelNotFoundException $exception) { + throw new NotFoundHttpException('Channel has not been found.'); } catch (\InvalidArgumentException $exception) { throw new NotFoundHttpException($exception->getMessage()); } diff --git a/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php b/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php index 1dfcf4cb2..c290802a5 100644 --- a/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php +++ b/src/Controller/Product/ShowProductCatalogByTaxonSlugAction.php @@ -6,6 +6,8 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; +use Sylius\Component\Channel\Context\ChannelNotFoundException; use Sylius\ShopApiPlugin\Model\PaginatorDetails; use Sylius\ShopApiPlugin\ViewRepository\Product\ProductCatalogViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; @@ -20,23 +22,32 @@ final class ShowProductCatalogByTaxonSlugAction /** @var ProductCatalogViewRepositoryInterface */ private $productCatalogQuery; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ViewHandlerInterface $viewHandler, - ProductCatalogViewRepositoryInterface $productCatalogQuery + ProductCatalogViewRepositoryInterface $productCatalogQuery, + ChannelContextInterface $channelContext ) { $this->viewHandler = $viewHandler; $this->productCatalogQuery = $productCatalogQuery; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { try { + $channel = $this->channelContext->getChannel(); + return $this->viewHandler->handle(View::create($this->productCatalogQuery->findByTaxonSlug( $request->attributes->get('taxonSlug'), - $request->attributes->get('channelCode'), + $channel->getCode(), new PaginatorDetails($request->attributes->get('_route'), $request->query->all()), $request->query->get('locale') ), Response::HTTP_OK)); + } catch (ChannelNotFoundException $exception) { + throw new NotFoundHttpException('Channel has not been found.'); } catch (\InvalidArgumentException $exception) { throw new NotFoundHttpException($exception->getMessage()); } diff --git a/src/Controller/Product/ShowProductDetailsByCodeAction.php b/src/Controller/Product/ShowProductDetailsByCodeAction.php index 935b6c254..763877590 100644 --- a/src/Controller/Product/ShowProductDetailsByCodeAction.php +++ b/src/Controller/Product/ShowProductDetailsByCodeAction.php @@ -6,6 +6,8 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; +use Sylius\Component\Channel\Context\ChannelNotFoundException; use Sylius\ShopApiPlugin\ViewRepository\Product\ProductDetailsViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -19,22 +21,31 @@ final class ShowProductDetailsByCodeAction /** @var ViewHandlerInterface */ private $viewHandler; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ProductDetailsViewRepositoryInterface $productCatalog, - ViewHandlerInterface $viewHandler + ViewHandlerInterface $viewHandler, + ChannelContextInterface $channelContext ) { $this->productCatalog = $productCatalog; $this->viewHandler = $viewHandler; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { try { + $channel = $this->channelContext->getChannel(); + return $this->viewHandler->handle(View::create($this->productCatalog->findOneByCode( $request->attributes->get('code'), - $request->attributes->get('channelCode'), + $channel->getCode(), $request->query->get('locale') ), Response::HTTP_OK)); + } catch (ChannelNotFoundException $exception) { + throw new NotFoundHttpException('Channel has not been found.'); } catch (\InvalidArgumentException $exception) { throw new NotFoundHttpException($exception->getMessage()); } diff --git a/src/Controller/Product/ShowProductDetailsBySlugAction.php b/src/Controller/Product/ShowProductDetailsBySlugAction.php index 8c40fb087..3bc44f95d 100644 --- a/src/Controller/Product/ShowProductDetailsBySlugAction.php +++ b/src/Controller/Product/ShowProductDetailsBySlugAction.php @@ -6,6 +6,8 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; +use Sylius\Component\Channel\Context\ChannelNotFoundException; use Sylius\ShopApiPlugin\ViewRepository\Product\ProductDetailsViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -19,22 +21,31 @@ final class ShowProductDetailsBySlugAction /** @var ViewHandlerInterface */ private $viewHandler; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ProductDetailsViewRepositoryInterface $productCatalog, - ViewHandlerInterface $viewHandler + ViewHandlerInterface $viewHandler, + ChannelContextInterface $channelContext ) { $this->productCatalog = $productCatalog; $this->viewHandler = $viewHandler; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { try { + $channel = $this->channelContext->getChannel(); + return $this->viewHandler->handle(View::create($this->productCatalog->findOneBySlug( $request->attributes->get('slug'), - $request->attributes->get('channelCode'), + $channel->getCode(), $request->query->get('locale') ), Response::HTTP_OK)); + } catch (ChannelNotFoundException $exception) { + throw new NotFoundHttpException('Channel has not been found.'); } catch (\InvalidArgumentException $exception) { throw new NotFoundHttpException($exception->getMessage()); } diff --git a/src/Controller/Product/ShowProductReviewsByCodeAction.php b/src/Controller/Product/ShowProductReviewsByCodeAction.php index eff94eab3..2444ab007 100644 --- a/src/Controller/Product/ShowProductReviewsByCodeAction.php +++ b/src/Controller/Product/ShowProductReviewsByCodeAction.php @@ -6,6 +6,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; use Sylius\ShopApiPlugin\Model\PaginatorDetails; use Sylius\ShopApiPlugin\ViewRepository\Product\ProductReviewsViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; @@ -19,19 +20,26 @@ final class ShowProductReviewsByCodeAction /** @var ProductReviewsViewRepositoryInterface */ private $productReviewsViewRepository; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ViewHandlerInterface $viewHandler, - ProductReviewsViewRepositoryInterface $productReviewsViewRepository + ProductReviewsViewRepositoryInterface $productReviewsViewRepository, + ChannelContextInterface $channelContext ) { $this->viewHandler = $viewHandler; $this->productReviewsViewRepository = $productReviewsViewRepository; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { + $channel = $this->channelContext->getChannel(); + $page = $this->productReviewsViewRepository->getByProductCode( $request->attributes->get('code'), - $request->attributes->get('channelCode'), + $channel->getCode(), new PaginatorDetails($request->attributes->get('_route'), $request->query->all()) ); diff --git a/src/Controller/Product/ShowProductReviewsBySlugAction.php b/src/Controller/Product/ShowProductReviewsBySlugAction.php index 7b23208a1..e71b8df4a 100644 --- a/src/Controller/Product/ShowProductReviewsBySlugAction.php +++ b/src/Controller/Product/ShowProductReviewsBySlugAction.php @@ -6,6 +6,7 @@ use FOS\RestBundle\View\View; use FOS\RestBundle\View\ViewHandlerInterface; +use Sylius\Component\Channel\Context\ChannelContextInterface; use Sylius\ShopApiPlugin\Model\PaginatorDetails; use Sylius\ShopApiPlugin\ViewRepository\Product\ProductReviewsViewRepositoryInterface; use Symfony\Component\HttpFoundation\Request; @@ -19,19 +20,26 @@ final class ShowProductReviewsBySlugAction /** @var ProductReviewsViewRepositoryInterface */ private $productReviewsViewRepository; + /** @var ChannelContextInterface */ + private $channelContext; + public function __construct( ViewHandlerInterface $viewHandler, - ProductReviewsViewRepositoryInterface $productReviewsViewRepository + ProductReviewsViewRepositoryInterface $productReviewsViewRepository, + ChannelContextInterface $channelContext ) { $this->viewHandler = $viewHandler; $this->productReviewsViewRepository = $productReviewsViewRepository; + $this->channelContext = $channelContext; } public function __invoke(Request $request): Response { + $channel = $this->channelContext->getChannel(); + $page = $this->productReviewsViewRepository->getByProductSlug( $request->attributes->get('slug'), - $request->attributes->get('channelCode'), + $channel->getCode(), new PaginatorDetails($request->attributes->get('_route'), $request->query->all()), $request->query->get('locale') ); diff --git a/src/Request/Product/AddProductReviewByCodeRequest.php b/src/Request/Product/AddProductReviewByCodeRequest.php index 9edd4dbb0..9a12cb05f 100644 --- a/src/Request/Product/AddProductReviewByCodeRequest.php +++ b/src/Request/Product/AddProductReviewByCodeRequest.php @@ -27,19 +27,26 @@ class AddProductReviewByCodeRequest /** @var string */ protected $email; - public function __construct(Request $request) + public function __construct(Request $request, string $channelCode) { $this->code = $request->attributes->get('code'); - $this->channelCode = $request->attributes->get('channelCode'); - $this->title = $request->request->get('title'); $this->rating = $request->request->get('rating'); $this->comment = $request->request->get('comment'); $this->email = $request->request->get('email'); + + $this->channelCode = $channelCode; } public function getCommand(): AddProductReviewByCode { - return new AddProductReviewByCode($this->code, $this->channelCode, $this->title, $this->rating, $this->comment, $this->email); + return new AddProductReviewByCode( + $this->code, + $this->channelCode, + $this->title, + $this->rating, + $this->comment, + $this->email + ); } } diff --git a/src/Request/Product/AddProductReviewBySlugRequest.php b/src/Request/Product/AddProductReviewBySlugRequest.php index 0a2ba735c..bdee11979 100644 --- a/src/Request/Product/AddProductReviewBySlugRequest.php +++ b/src/Request/Product/AddProductReviewBySlugRequest.php @@ -27,19 +27,26 @@ class AddProductReviewBySlugRequest /** @var string */ protected $email; - public function __construct(Request $request) + public function __construct(Request $request, string $channelCode) { $this->slug = $request->attributes->get('slug'); - $this->channelCode = $request->attributes->get('channelCode'); - $this->title = $request->request->get('title'); $this->rating = $request->request->get('rating'); $this->comment = $request->request->get('comment'); $this->email = $request->request->get('email'); + + $this->channelCode = $channelCode; } public function getCommand(): AddProductReviewBySlug { - return new AddProductReviewBySlug($this->slug, $this->channelCode, $this->title, $this->rating, $this->comment, $this->email); + return new AddProductReviewBySlug( + $this->slug, + $this->channelCode, + $this->title, + $this->rating, + $this->comment, + $this->email + ); } } diff --git a/src/Resources/config/routing.yml b/src/Resources/config/routing.yml index 215eb8bf9..915da0c92 100644 --- a/src/Resources/config/routing.yml +++ b/src/Resources/config/routing.yml @@ -4,11 +4,11 @@ sylius_shop_api_cart: sylius_shop_api_product_by_slug: resource: "@ShopApiPlugin/Resources/config/routing/productBySlug.yml" - prefix: /shop-api/{channelCode} + prefix: /shop-api sylius_shop_api_product_by_code: resource: "@ShopApiPlugin/Resources/config/routing/productByCode.yml" - prefix: /shop-api/{channelCode} + prefix: /shop-api sylius_shop_api_taxon: resource: "@ShopApiPlugin/Resources/config/routing/taxon.yml" @@ -28,7 +28,7 @@ sylius_shop_api_customer: sylius_shop_api_product_list: resource: "@ShopApiPlugin/Resources/config/routing/productList.yml" - prefix: /shop-api/{channelCode} + prefix: /shop-api sylius_shop_api_address_book: resource: "@ShopApiPlugin/Resources/config/routing/address_book.yml" diff --git a/src/Resources/config/serializer/Product/ProductView.yml b/src/Resources/config/serializer/Product/ProductView.yml index 9ab2e455a..da04de0c9 100644 --- a/src/Resources/config/serializer/Product/ProductView.yml +++ b/src/Resources/config/serializer/Product/ProductView.yml @@ -51,5 +51,4 @@ Sylius\ShopApiPlugin\View\Product\ProductView: href: route: sylius_shop_api_product_show_details_by_slug parameters: - channelCode: expr(object.channelCode) slug: expr(object.slug) diff --git a/src/Resources/config/services/actions/product.xml b/src/Resources/config/services/actions/product.xml index e0001cd0d..ba287d5ca 100644 --- a/src/Resources/config/services/actions/product.xml +++ b/src/Resources/config/services/actions/product.xml @@ -9,12 +9,15 @@ > + + + + + + + + + + diff --git a/src/ViewRepository/Product/ProductCatalogViewRepository.php b/src/ViewRepository/Product/ProductCatalogViewRepository.php index b94ebdb6b..00af80ab9 100644 --- a/src/ViewRepository/Product/ProductCatalogViewRepository.php +++ b/src/ViewRepository/Product/ProductCatalogViewRepository.php @@ -64,7 +64,6 @@ public function findByTaxonSlug(string $taxonSlug, string $channelCode, Paginato Assert::notNull($taxon, sprintf('Taxon with slug %s in locale %s has not been found', $taxonSlug, $localeCode)); $paginatorDetails->addToParameters('taxonSlug', $taxonSlug); - $paginatorDetails->addToParameters('channelCode', $channelCode); return $this->findByTaxon($taxon, $channel, $paginatorDetails, $localeCode); } @@ -79,7 +78,6 @@ public function findByTaxonCode(string $taxonCode, string $channelCode, Paginato Assert::notNull($taxon, sprintf('Taxon with code %s has not been found', $taxonCode)); $paginatorDetails->addToParameters('taxonCode', $taxonCode); - $paginatorDetails->addToParameters('channelCode', $channelCode); return $this->findByTaxon($taxon, $channel, $paginatorDetails, $localeCode); } diff --git a/src/ViewRepository/Product/ProductReviewsViewRepository.php b/src/ViewRepository/Product/ProductReviewsViewRepository.php index 5cf042c05..84286dfe5 100644 --- a/src/ViewRepository/Product/ProductReviewsViewRepository.php +++ b/src/ViewRepository/Product/ProductReviewsViewRepository.php @@ -62,7 +62,6 @@ public function getByProductSlug(string $productSlug, string $channelCode, Pagin $reviews = $this->productReviewRepository->findAcceptedByProductSlugAndChannel($productSlug, $localeCode, $channel); $paginatorDetails->addToParameters('slug', $productSlug); - $paginatorDetails->addToParameters('channelCode', $channelCode); return $this->createProductReviewPage($reviews, $paginatorDetails); } @@ -77,7 +76,6 @@ public function getByProductCode(string $productCode, string $channelCode, Pagin $reviews = $this->productReviewRepository->findBy(['reviewSubject' => $product->getId(), 'status' => ReviewInterface::STATUS_ACCEPTED]); $paginatorDetails->addToParameters('code', $productCode); - $paginatorDetails->addToParameters('channelCode', $channelCode); return $this->createProductReviewPage($reviews, $paginatorDetails); } diff --git a/tests/Controller/Product/ProductAddReviewByCodeApiTest.php b/tests/Controller/Product/ProductAddReviewByCodeApiTest.php index 62268b272..7d54d5732 100644 --- a/tests/Controller/Product/ProductAddReviewByCodeApiTest.php +++ b/tests/Controller/Product/ProductAddReviewByCodeApiTest.php @@ -25,7 +25,7 @@ public function it_adds_review_to_product(): void "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponseCode($response, Response::HTTP_CREATED); @@ -47,34 +47,12 @@ public function it_adds_review_to_the_product_for_registered_user(): void "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponseCode($response, Response::HTTP_CREATED); } - /** - * @test - */ - public function it_does_not_allow_to_add_product_review_by_code_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['shop.yml']); - - $data = -<<client->request('POST', '/shop-api/SPACE_KLINGON/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } - /** * @test */ @@ -93,7 +71,7 @@ public function it_does_not_allow_to_add_review_when_rating_is_out_of_bounds(): } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'reviews/add_review_failed_rating', Response::HTTP_BAD_REQUEST); @@ -117,7 +95,7 @@ public function it_does_not_allow_to_add_review_when_email_is_not_valid(): void } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'reviews/add_review_failed_email', Response::HTTP_BAD_REQUEST); diff --git a/tests/Controller/Product/ProductAddReviewBySlugApiTest.php b/tests/Controller/Product/ProductAddReviewBySlugApiTest.php index cd47b9c80..af55f888e 100644 --- a/tests/Controller/Product/ProductAddReviewBySlugApiTest.php +++ b/tests/Controller/Product/ProductAddReviewBySlugApiTest.php @@ -25,7 +25,7 @@ public function it_adds_review_to_product(): void "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/products/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponseCode($response, Response::HTTP_CREATED); @@ -47,34 +47,12 @@ public function it_adds_review_to_the_product_for_registered_user(): void "email": "oliver@example.com" } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/products/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponseCode($response, Response::HTTP_CREATED); } - /** - * @test - */ - public function it_does_not_allow_to_add_product_review_by_slug_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['shop.yml']); - - $data = -<<client->request('POST', '/shop-api/SPACE_KLINGON/products/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } - /** * @test */ @@ -92,7 +70,7 @@ public function it_does_not_allow_to_add_review_when_rating_is_out_of_bounds(): } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/by-slug/mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/products/by-slug/mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'reviews/add_review_failed_rating', Response::HTTP_BAD_REQUEST); @@ -115,7 +93,7 @@ public function it_does_not_allow_to_add_review_when_rating_email_is_not_valid() } EOT; - $this->client->request('POST', '/shop-api/WEB_GB/products/by-slug/mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); + $this->client->request('POST', '/shop-api/products/by-slug/mug/reviews', [], [], self::CONTENT_TYPE_HEADER, $data); $response = $this->client->getResponse(); $this->assertResponse($response, 'reviews/add_review_failed_email', Response::HTTP_BAD_REQUEST); diff --git a/tests/Controller/Product/ProductShowCatalogByCodeApiTest.php b/tests/Controller/Product/ProductShowCatalogByCodeApiTest.php index 991d2d797..e4fdc536e 100644 --- a/tests/Controller/Product/ProductShowCatalogByCodeApiTest.php +++ b/tests/Controller/Product/ProductShowCatalogByCodeApiTest.php @@ -16,7 +16,7 @@ public function it_shows_paginated_products_from_some_taxon_by_code(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-code/BRAND', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-code/BRAND', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_page_by_code_response', Response::HTTP_OK); @@ -29,7 +29,7 @@ public function it_shows_products_for_sub_taxons_by_code(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-code/WOMEN_T_SHIRTS', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-code/WOMEN_T_SHIRTS', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_t_shirt_list_page_by_code_response', Response::HTTP_OK); @@ -42,7 +42,7 @@ public function it_shows_paginated_products_from_some_taxon_by_code_in_different { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-code/BRAND?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-code/BRAND?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_product_list_page_by_code_response', Response::HTTP_OK); @@ -55,22 +55,9 @@ public function it_shows_second_page_of_paginated_products_from_some_taxon_by_co { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-code/BRAND?limit=1&page=2', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-code/BRAND?limit=1&page=2', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/limited_product_list_page_by_code_response', Response::HTTP_OK); } - - /** - * @test - */ - public function it_does_not_show_product_catalog_by_code_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['shop.yml']); - - $this->client->request('GET', '/shop-api/SPACE_KLINGON/taxon-products/by-code/BRAND', [], [], self::CONTENT_TYPE_HEADER); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } } diff --git a/tests/Controller/Product/ProductShowCatalogBySlugApiTest.php b/tests/Controller/Product/ProductShowCatalogBySlugApiTest.php index a6a2d3152..156936a64 100644 --- a/tests/Controller/Product/ProductShowCatalogBySlugApiTest.php +++ b/tests/Controller/Product/ProductShowCatalogBySlugApiTest.php @@ -16,7 +16,7 @@ public function it_shows_paginated_products_from_some_taxon_by_slug(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/brands', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-slug/brands', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_page_by_slug_response', Response::HTTP_OK); @@ -29,7 +29,7 @@ public function it_shows_products_for_sub_taxons_by_slug(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/categories/t-shirts/women-t-shirts', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-slug/categories/t-shirts/women-t-shirts', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_t_shirt_list_page_by_slug_response', Response::HTTP_OK); @@ -42,7 +42,7 @@ public function it_shows_paginated_products_from_some_taxon_by_slug_in_different { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/marken?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-slug/marken?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_product_list_page_by_slug_response', Response::HTTP_OK); @@ -55,7 +55,7 @@ public function it_shows_second_page_of_paginated_products_from_some_taxon_by_sl { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/brands?limit=1&page=2', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-slug/brands?limit=1&page=2', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/limited_product_list_page_by_slug_response', Response::HTTP_OK); @@ -68,7 +68,7 @@ public function it_shows_sorted_product_list(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/x-man?sorting[createdAt]=desc', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-slug/x-man?sorting[createdAt]=desc', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_page_by_slug_response', Response::HTTP_OK); @@ -81,22 +81,9 @@ public function it_expose_only_some_of_products_in_the_list(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/taxon-products/by-slug/x-man?criteria[search][value]=Logans+Hat', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/taxon-products/by-slug/x-man?criteria[search][value]=Logans+Hat', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_page_by_slug_response', Response::HTTP_OK); } - - /** - * @test - */ - public function it_does_not_show_product_catalog_by_slug_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['shop.yml']); - - $this->client->request('GET', '/shop-api/SPACE_KLINGON/taxon-products/by-slug/brands', [], [], self::CONTENT_TYPE_HEADER); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } } diff --git a/tests/Controller/Product/ProductShowDetailsByCodeApiTest.php b/tests/Controller/Product/ProductShowDetailsByCodeApiTest.php index 56c345c5c..aa9ec8393 100644 --- a/tests/Controller/Product/ProductShowDetailsByCodeApiTest.php +++ b/tests/Controller/Product/ProductShowDetailsByCodeApiTest.php @@ -16,7 +16,7 @@ public function it_shows_simple_product_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-code/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/simple_product_details_page', Response::HTTP_OK); @@ -27,7 +27,7 @@ public function it_shows_simple_product_details_page(): void */ public function it_throws_a_not_found_exception_if_channel_has_not_been_found(): void { - $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-code/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); @@ -40,7 +40,7 @@ public function it_throws_a_not_found_exception_if_product_has_not_been_found(): { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/WRONG_PRODUCT_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-code/WRONG_PRODUCT_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_has_not_been_found_for_given_code_response', Response::HTTP_NOT_FOUND); @@ -53,7 +53,7 @@ public function it_shows_simple_product_details_page_in_different_locale(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-code/LOGAN_MUG_CODE?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_simple_product_details_page', Response::HTTP_OK); @@ -66,7 +66,7 @@ public function it_shows_product_with_variant_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_T_SHIRT_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-code/LOGAN_T_SHIRT_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_with_variant_details_page', Response::HTTP_OK); @@ -79,7 +79,7 @@ public function it_shows_product_with_options_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_HAT_CODE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-code/LOGAN_HAT_CODE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_with_options_details_page', Response::HTTP_OK); @@ -92,22 +92,9 @@ public function it_shows_product_with_options_details_page_in_different_locale() { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_HAT_CODE?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-code/LOGAN_HAT_CODE?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_product_with_options_details_page', Response::HTTP_OK); } - - /** - * @test - */ - public function it_does_not_show_product_details_by_code_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['shop.yml']); - - $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/by-code/LOGAN_MUG_CODE', [], [], self::CONTENT_TYPE_HEADER); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } } diff --git a/tests/Controller/Product/ProductShowDetailsBySlugApiTest.php b/tests/Controller/Product/ProductShowDetailsBySlugApiTest.php index efb45d21e..b19692602 100644 --- a/tests/Controller/Product/ProductShowDetailsBySlugApiTest.php +++ b/tests/Controller/Product/ProductShowDetailsBySlugApiTest.php @@ -16,7 +16,7 @@ public function it_shows_simple_product_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/simple_product_details_page', Response::HTTP_OK); @@ -29,7 +29,7 @@ public function it_shows_product_without_taxon_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-shoes', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/logan-shoes', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_without_taxons_details_page', Response::HTTP_OK); @@ -40,7 +40,7 @@ public function it_shows_product_without_taxon_details_page(): void */ public function it_throws_a_not_found_exception_if_channel_has_not_been_found(): void { - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); @@ -53,7 +53,7 @@ public function it_throws_a_not_found_exception_if_product_has_not_been_found(): { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/some-weird-stuff', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/some-weird-stuff', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_has_not_been_found_for_given_slug_response', Response::HTTP_NOT_FOUND); @@ -66,7 +66,7 @@ public function it_shows_simple_product_details_page_in_different_locale(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-becher?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/logan-becher?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_simple_product_details_page', Response::HTTP_OK); @@ -79,7 +79,7 @@ public function it_shows_product_with_variant_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-t-shirt', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/logan-t-shirt', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_with_variant_details_page', Response::HTTP_OK); @@ -92,7 +92,7 @@ public function it_shows_product_with_options_details_page(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-hat', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/logan-hat', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_with_options_details_page', Response::HTTP_OK); @@ -105,22 +105,9 @@ public function it_shows_product_with_options_details_page_in_different_locale() { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-hut?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/logan-hut?locale=de_DE', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/german_product_with_options_details_page', Response::HTTP_OK); } - - /** - * @test - */ - public function it_does_not_show_product_details_by_slug_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['shop.yml']); - - $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/by-slug/logan-mug', [], [], self::CONTENT_TYPE_HEADER); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } } diff --git a/tests/Controller/Product/ProductShowLatestApiTest.php b/tests/Controller/Product/ProductShowLatestApiTest.php index 3ea9f4101..4c2177500 100644 --- a/tests/Controller/Product/ProductShowLatestApiTest.php +++ b/tests/Controller/Product/ProductShowLatestApiTest.php @@ -16,7 +16,7 @@ public function it_shows_latest_products_with_default_count(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/product-latest/', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/product-latest/', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); @@ -30,24 +30,10 @@ public function it_shows_latest_2_products(): void { $this->loadFixturesFromFiles(['shop.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/product-latest/', ['limit' => 2], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/product-latest/', ['limit' => 2], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_list_latest_2_response', Response::HTTP_OK); } - - /** - * @test - */ - public function it_does_not_show_latest_products_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['shop.yml']); - - $this->client->request('GET', '/shop-api/SPACE_KLINGON/product-latest/', [], [], self::CONTENT_TYPE_HEADER); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } } diff --git a/tests/Controller/Product/ProductShowReviewsByCodeApiTest.php b/tests/Controller/Product/ProductShowReviewsByCodeApiTest.php index d144bdbf9..3c8137078 100644 --- a/tests/Controller/Product/ProductShowReviewsByCodeApiTest.php +++ b/tests/Controller/Product/ProductShowReviewsByCodeApiTest.php @@ -16,22 +16,9 @@ public function it_shows_reviews_for_product_by_slug(): void { $this->loadFixturesFromFiles(['shop.yml', 'customer.yml', 'mug_review.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_review_list_page_by_code_response', Response::HTTP_OK); } - - /** - * @test - */ - public function it_does_not_show_product_reviews_by_code_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['channel.yml']); - - $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/by-code/LOGAN_MUG_CODE/reviews', [], [], self::CONTENT_TYPE_HEADER); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } } diff --git a/tests/Controller/Product/ProductShowReviewsBySlugApiTest.php b/tests/Controller/Product/ProductShowReviewsBySlugApiTest.php index dd700446f..f61b089e7 100644 --- a/tests/Controller/Product/ProductShowReviewsBySlugApiTest.php +++ b/tests/Controller/Product/ProductShowReviewsBySlugApiTest.php @@ -16,22 +16,9 @@ public function it_shows_reviews_for_product_by_slug(): void { $this->loadFixturesFromFiles(['shop.yml', 'customer.yml', 'mug_review.yml']); - $this->client->request('GET', '/shop-api/WEB_GB/products/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER); + $this->client->request('GET', '/shop-api/products/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER); $response = $this->client->getResponse(); $this->assertResponse($response, 'product/product_review_list_page_by_slug_response', Response::HTTP_OK); } - - /** - * @test - */ - public function it_does_not_show_product_reviews_by_slug_in_non_existent_channel(): void - { - $this->loadFixturesFromFiles(['channel.yml']); - - $this->client->request('GET', '/shop-api/SPACE_KLINGON/products/by-slug/logan-mug/reviews', [], [], self::CONTENT_TYPE_HEADER); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'channel_has_not_been_found_response', Response::HTTP_NOT_FOUND); - } } diff --git a/tests/Responses/Expected/product/channel_has_not_been_found_response.json b/tests/Responses/Expected/product/channel_has_not_been_found_response.json index 71b23ac54..522715ddb 100644 --- a/tests/Responses/Expected/product/channel_has_not_been_found_response.json +++ b/tests/Responses/Expected/product/channel_has_not_been_found_response.json @@ -1,4 +1,4 @@ { "code": 404, - "message": "Channel with code WEB_GB has not been found." + "message": "Channel has not been found." } diff --git a/tests/Responses/Expected/product/german_product_list_page_by_code_response.json b/tests/Responses/Expected/product/german_product_list_page_by_code_response.json index 57cb7088c..c2f65bd8d 100644 --- a/tests/Responses/Expected/product/german_product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/german_product_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 2, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10" + "self": "\/shop-api\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", + "first": "\/shop-api\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", + "last": "\/shop-api\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10", + "next": "\/shop-api\/taxon-products\/by-code\/BRAND?locale=de_DE&page=1&limit=10" }, "items": [ { @@ -57,7 +57,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" + "href": "\/shop-api\/products\/by-slug\/logan-becher" } } }, @@ -195,7 +195,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" + "href": "\/shop-api\/products\/by-slug\/logan-becher" } } }, @@ -265,7 +265,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -274,7 +274,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hut" + "href": "\/shop-api\/products\/by-slug\/logan-hut" } } } diff --git a/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json b/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json index f99fa0e86..171bf944d 100644 --- a/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/german_product_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 2, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10" + "self": "\/shop-api\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", + "first": "\/shop-api\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", + "last": "\/shop-api\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10", + "next": "\/shop-api\/taxon-products\/by-slug\/marken?locale=de_DE&page=1&limit=10" }, "items": [ { @@ -57,7 +57,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" + "href": "\/shop-api\/products\/by-slug\/logan-becher" } } }, @@ -195,7 +195,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" + "href": "\/shop-api\/products\/by-slug\/logan-becher" } } }, @@ -265,7 +265,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -274,7 +274,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hut" + "href": "\/shop-api\/products\/by-slug\/logan-hut" } } } diff --git a/tests/Responses/Expected/product/german_product_with_options_details_page.json b/tests/Responses/Expected/product/german_product_with_options_details_page.json index bb7da9558..87871fba7 100644 --- a/tests/Responses/Expected/product/german_product_with_options_details_page.json +++ b/tests/Responses/Expected/product/german_product_with_options_details_page.json @@ -133,7 +133,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" + "href": "\/shop-api\/products\/by-slug\/logan-becher" } } }, @@ -203,7 +203,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -212,7 +212,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hut" + "href": "\/shop-api\/products\/by-slug\/logan-hut" } } } diff --git a/tests/Responses/Expected/product/german_simple_product_details_page.json b/tests/Responses/Expected/product/german_simple_product_details_page.json index 4929f32dc..ac909a0a5 100644 --- a/tests/Responses/Expected/product/german_simple_product_details_page.json +++ b/tests/Responses/Expected/product/german_simple_product_details_page.json @@ -46,7 +46,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-becher" + "href": "\/shop-api\/products\/by-slug\/logan-becher" } } } diff --git a/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json b/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json index e544c5fd6..12b319c3f 100644 --- a/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/limited_product_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 3, "total": 3, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?limit=1&page=2", - "first": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?limit=1&page=1", - "last": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?limit=1&page=3", - "next": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?limit=1&page=3" + "self": "\/shop-api\/taxon-products\/by-code\/BRAND?limit=1&page=2", + "first": "\/shop-api\/taxon-products\/by-code\/BRAND?limit=1&page=1", + "last": "\/shop-api\/taxon-products\/by-code\/BRAND?limit=1&page=3", + "next": "\/shop-api\/taxon-products\/by-code\/BRAND?limit=1&page=3" }, "items": [ { @@ -76,7 +76,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json b/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json index 1b2c56c49..6e163f65d 100644 --- a/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/limited_product_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 3, "total": 3, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?limit=1&page=2", - "first": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?limit=1&page=1", - "last": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?limit=1&page=3", - "next": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?limit=1&page=3" + "self": "\/shop-api\/taxon-products\/by-slug\/brands?limit=1&page=2", + "first": "\/shop-api\/taxon-products\/by-slug\/brands?limit=1&page=1", + "last": "\/shop-api\/taxon-products\/by-slug\/brands?limit=1&page=3", + "next": "\/shop-api\/taxon-products\/by-slug\/brands?limit=1&page=3" }, "items": [ { @@ -76,7 +76,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_list_latest_2_response.json b/tests/Responses/Expected/product/product_list_latest_2_response.json index 521ba1244..c94615557 100644 --- a/tests/Responses/Expected/product/product_list_latest_2_response.json +++ b/tests/Responses/Expected/product/product_list_latest_2_response.json @@ -135,7 +135,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }, @@ -205,7 +205,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -214,7 +214,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } }, @@ -266,7 +266,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/product/product_list_latest_4_response.json b/tests/Responses/Expected/product/product_list_latest_4_response.json index e7881285c..1dd597fcb 100644 --- a/tests/Responses/Expected/product/product_list_latest_4_response.json +++ b/tests/Responses/Expected/product/product_list_latest_4_response.json @@ -135,7 +135,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }, @@ -205,7 +205,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -214,7 +214,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } }, @@ -266,7 +266,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }, @@ -286,7 +286,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-shoes" + "href": "\/shop-api\/products\/by-slug\/logan-shoes" } } }, @@ -356,7 +356,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_list_page_by_code_response.json b/tests/Responses/Expected/product/product_list_page_by_code_response.json index b574fbdfc..a79134e41 100644 --- a/tests/Responses/Expected/product/product_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 3, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/BRAND?page=1&limit=10" + "self": "\/shop-api\/taxon-products\/by-code\/BRAND?page=1&limit=10", + "first": "\/shop-api\/taxon-products\/by-code\/BRAND?page=1&limit=10", + "last": "\/shop-api\/taxon-products\/by-code\/BRAND?page=1&limit=10", + "next": "\/shop-api\/taxon-products\/by-code\/BRAND?page=1&limit=10" }, "items": [ { @@ -58,7 +58,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }, @@ -128,7 +128,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } }, @@ -267,7 +267,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }, @@ -337,7 +337,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -346,7 +346,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/product/product_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_list_page_by_slug_response.json index bcd521a1d..4aac6dd91 100644 --- a/tests/Responses/Expected/product/product_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 3, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/brands?page=1&limit=10" + "self": "\/shop-api\/taxon-products\/by-slug\/brands?page=1&limit=10", + "first": "\/shop-api\/taxon-products\/by-slug\/brands?page=1&limit=10", + "last": "\/shop-api\/taxon-products\/by-slug\/brands?page=1&limit=10", + "next": "\/shop-api\/taxon-products\/by-slug\/brands?page=1&limit=10" }, "items": [ { @@ -58,7 +58,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }, @@ -128,7 +128,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } }, @@ -267,7 +267,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }, @@ -337,7 +337,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -346,7 +346,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/product/product_review_list_page_by_code_response.json b/tests/Responses/Expected/product/product_review_list_page_by_code_response.json index 75aa1760f..aadeb94ca 100644 --- a/tests/Responses/Expected/product/product_review_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_review_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 3, "total": 25, "_links": { - "self": "\/shop-api\/WEB_GB\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=3&limit=10", - "next": "\/shop-api\/WEB_GB\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=2&limit=10" + "self": "\/shop-api\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=1&limit=10", + "first": "\/shop-api\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=1&limit=10", + "last": "\/shop-api\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=3&limit=10", + "next": "\/shop-api\/products\/by-code\/LOGAN_MUG_CODE\/reviews?page=2&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/product_review_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_review_list_page_by_slug_response.json index f725330d6..1def374c4 100644 --- a/tests/Responses/Expected/product/product_review_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_review_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 3, "total": 25, "_links": { - "self": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug\/reviews?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug\/reviews?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug\/reviews?page=3&limit=10", - "next": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug\/reviews?page=2&limit=10" + "self": "\/shop-api\/products\/by-slug\/logan-mug\/reviews?page=1&limit=10", + "first": "\/shop-api\/products\/by-slug\/logan-mug\/reviews?page=1&limit=10", + "last": "\/shop-api\/products\/by-slug\/logan-mug\/reviews?page=3&limit=10", + "next": "\/shop-api\/products\/by-slug\/logan-mug\/reviews?page=2&limit=10" }, "items": [ { diff --git a/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json b/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json index 4165cbb1e..c83914422 100644 --- a/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json +++ b/tests/Responses/Expected/product/product_t_shirt_list_page_by_code_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 1, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10" + "self": "\/shop-api\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", + "first": "\/shop-api\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", + "last": "\/shop-api\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10", + "next": "\/shop-api\/taxon-products\/by-code\/WOMEN_T_SHIRTS?page=1&limit=10" }, "items": [ { @@ -76,7 +76,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json b/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json index 447c2a932..9870ae890 100644 --- a/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json +++ b/tests/Responses/Expected/product/product_t_shirt_list_page_by_slug_response.json @@ -4,10 +4,10 @@ "pages": 1, "total": 1, "_links": { - "self": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", - "first": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", - "last": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", - "next": "\/shop-api\/WEB_GB\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10" + "self": "\/shop-api\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", + "first": "\/shop-api\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", + "last": "\/shop-api\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10", + "next": "\/shop-api\/taxon-products\/by-slug\/categories\/t-shirts\/women-t-shirts?page=1&limit=10" }, "items": [ { @@ -76,7 +76,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_with_options_details_page.json b/tests/Responses/Expected/product/product_with_options_details_page.json index e13df7f78..9cf437c67 100644 --- a/tests/Responses/Expected/product/product_with_options_details_page.json +++ b/tests/Responses/Expected/product/product_with_options_details_page.json @@ -134,7 +134,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }, @@ -204,7 +204,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -213,7 +213,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/product/product_with_variant_details_page.json b/tests/Responses/Expected/product/product_with_variant_details_page.json index e67975320..659b83fb2 100644 --- a/tests/Responses/Expected/product/product_with_variant_details_page.json +++ b/tests/Responses/Expected/product/product_with_variant_details_page.json @@ -65,7 +65,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/product/product_without_taxons_details_page.json b/tests/Responses/Expected/product/product_without_taxons_details_page.json index 2164d1aed..e7602bd11 100644 --- a/tests/Responses/Expected/product/product_without_taxons_details_page.json +++ b/tests/Responses/Expected/product/product_without_taxons_details_page.json @@ -15,7 +15,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-shoes" + "href": "\/shop-api\/products\/by-slug\/logan-shoes" } } } diff --git a/tests/Responses/Expected/product/simple_product_details_page.json b/tests/Responses/Expected/product/simple_product_details_page.json index 71567ed97..528f2ac4b 100644 --- a/tests/Responses/Expected/product/simple_product_details_page.json +++ b/tests/Responses/Expected/product/simple_product_details_page.json @@ -47,7 +47,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } From 98a3f8f072caf8709b1d103ab9e45f0794ed04bc Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Fri, 19 Jul 2019 07:11:57 +0200 Subject: [PATCH 2/2] Fixes --- .../AddProductReviewByCodeRequestTest.php | 24 ++++++++++++------- .../AddProductReviewBySlugRequestTest.php | 24 ++++++++++++------- ...dd_multiple_products_to_cart_response.json | 6 ++--- ...ultiple_products_to_new_cart_response.json | 6 ++--- ...tions_multiple_times_to_cart_response.json | 2 +- ...ant_based_on_options_to_cart_response.json | 2 +- ...riant_multiple_times_to_cart_response.json | 2 +- .../add_product_variant_to_cart_response.json | 2 +- ...oduct_multiple_times_to_cart_response.json | 2 +- .../add_simple_product_to_cart_response.json | 2 +- ...d_simple_product_to_new_cart_response.json | 2 +- ...upon_based_promotion_applied_response.json | 2 +- ...with_product_variant_summary_response.json | 4 ++-- ..._with_simple_product_summary_response.json | 2 +- ...with_product_variant_summary_response.json | 2 +- ..._with_simple_product_summary_response.json | 2 +- ...processed_cart_after_deleting_an_item.json | 2 +- .../checkout/cart_addressed_response.json | 2 +- ...shipping_and_billing_address_response.json | 2 +- .../cart_with_chosen_payment_response.json | 2 +- .../cart_with_chosen_shipment_response.json | 2 +- ..._shipment_with_per_item_rate_response.json | 2 +- ..._shipment_with_per_item_rate_response.json | 2 +- .../order/order_details_response.json | 2 +- .../order/order_details_response_guest.json | 2 +- .../Expected/order/orders_list_response.json | 2 +- 26 files changed, 59 insertions(+), 47 deletions(-) diff --git a/tests/Request/AddProductReviewByCodeRequestTest.php b/tests/Request/AddProductReviewByCodeRequestTest.php index 6caa9706e..3d460d967 100644 --- a/tests/Request/AddProductReviewByCodeRequestTest.php +++ b/tests/Request/AddProductReviewByCodeRequestTest.php @@ -16,15 +16,21 @@ final class AddProductReviewByCodeRequestTest extends TestCase */ public function it_creates_review_with_author() { - $addReviewRequest = new AddProductReviewByCodeRequest(new Request([], [ - 'title' => 'Awesome beer', - 'rating' => 5, - 'comment' => 'I love this beer', - 'email' => 'pale.ale@brewery.com', - ], [ - 'channelCode' => 'WEB_GB', - 'code' => 'PALE_ALE_CODE', - ])); + $addReviewRequest = new AddProductReviewByCodeRequest( + new Request( + [], + [ + 'title' => 'Awesome beer', + 'rating' => 5, + 'comment' => 'I love this beer', + 'email' => 'pale.ale@brewery.com', + ], + [ + 'code' => 'PALE_ALE_CODE', + ] + ), + 'WEB_GB' + ); $this->assertEquals($addReviewRequest->getCommand(), new AddProductReviewByCode( 'PALE_ALE_CODE', diff --git a/tests/Request/AddProductReviewBySlugRequestTest.php b/tests/Request/AddProductReviewBySlugRequestTest.php index ceb243da7..7822e0082 100644 --- a/tests/Request/AddProductReviewBySlugRequestTest.php +++ b/tests/Request/AddProductReviewBySlugRequestTest.php @@ -16,15 +16,21 @@ final class AddProductReviewBySlugRequestTest extends TestCase */ public function it_creates_review_with_author() { - $addReviewRequest = new AddProductReviewBySlugRequest(new Request([], [ - 'title' => 'Awesome beer', - 'rating' => 5, - 'comment' => 'I love this beer', - 'email' => 'pale.ale@brewery.com', - ], [ - 'channelCode' => 'WEB_GB', - 'slug' => 'pale-ale', - ])); + $addReviewRequest = new AddProductReviewBySlugRequest( + new Request( + [], + [ + 'title' => 'Awesome beer', + 'rating' => 5, + 'comment' => 'I love this beer', + 'email' => 'pale.ale@brewery.com', + ], + [ + 'slug' => 'pale-ale', + ] + ), + 'WEB_GB' + ); $this->assertEquals($addReviewRequest->getCommand(), new AddProductReviewBySlug( 'pale-ale', diff --git a/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json b/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json index 8474e0ed9..7864db4cb 100644 --- a/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_multiple_products_to_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } @@ -106,7 +106,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -153,7 +153,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json b/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json index 0ef858fd7..b3ce6804e 100644 --- a/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json +++ b/tests/Responses/Expected/cart/add_multiple_products_to_new_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } @@ -106,7 +106,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -153,7 +153,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json index cced5f812..2520e8371 100644 --- a/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_based_on_options_multiple_times_to_cart_response.json @@ -47,7 +47,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json index b0ca4c82b..c5ba71795 100644 --- a/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_based_on_options_to_cart_response.json @@ -47,7 +47,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json index 78011be59..0a578c293 100644 --- a/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_multiple_times_to_cart_response.json @@ -54,7 +54,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json b/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json index 821f3dd27..accbaa6ec 100644 --- a/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_product_variant_to_cart_response.json @@ -54,7 +54,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } diff --git a/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json index 933f84477..09011e06a 100644 --- a/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_multiple_times_to_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json index 024a0a0b0..c90e34457 100644 --- a/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_to_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json b/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json index 809238994..be0dab646 100644 --- a/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json +++ b/tests/Responses/Expected/cart/add_simple_product_to_new_cart_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json b/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json index be28fe9ab..4354413e6 100644 --- a/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json +++ b/tests/Responses/Expected/cart/cart_with_coupon_based_promotion_applied_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json b/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json index 720ca9905..70a3dbd8d 100644 --- a/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json +++ b/tests/Responses/Expected/cart/filled_cart_with_product_variant_summary_response.json @@ -54,7 +54,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-t-shirt" + "href": "\/shop-api\/products\/by-slug\/logan-t-shirt" } } } @@ -101,7 +101,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-hat" + "href": "\/shop-api\/products\/by-slug\/logan-hat" } } } diff --git a/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json b/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json index 2b988c6d6..aa900bef3 100644 --- a/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json +++ b/tests/Responses/Expected/cart/filled_cart_with_simple_product_summary_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json b/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json index 0ab2bb351..d6687df3b 100644 --- a/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json +++ b/tests/Responses/Expected/cart/german_filled_cart_with_product_variant_summary_response.json @@ -47,7 +47,7 @@ "images": [], "_links": { "self": { - "href": "\/shop-api\/WEB_DE\/products\/by-slug\/logan-hut" + "href": "\/shop-api\/products\/by-slug\/logan-hut" } } } diff --git a/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json b/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json index d7114e323..5e0dfd0f5 100644 --- a/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json +++ b/tests/Responses/Expected/cart/german_filled_cart_with_simple_product_summary_response.json @@ -51,7 +51,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_DE\/products\/by-slug\/logan-becher" + "href": "\/shop-api\/products\/by-slug\/logan-becher" } } } diff --git a/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json b/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json index a58fe8e2b..3e41ad834 100644 --- a/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json +++ b/tests/Responses/Expected/cart/reprocessed_cart_after_deleting_an_item.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_addressed_response.json b/tests/Responses/Expected/checkout/cart_addressed_response.json index 37b9e1de4..1838677cd 100644 --- a/tests/Responses/Expected/checkout/cart_addressed_response.json +++ b/tests/Responses/Expected/checkout/cart_addressed_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json b/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json index 76e978bbb..f9177546c 100644 --- a/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json +++ b/tests/Responses/Expected/checkout/cart_addressed_with_different_shipping_and_billing_address_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json index 602c384be..b694700af 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_payment_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json index 8ae48b4ee..8c19efe09 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json index 395b6776f..fc20b9a9d 100644 --- a/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json +++ b/tests/Responses/Expected/checkout/cart_with_chosen_shipment_with_per_item_rate_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json b/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json index 1854aeca3..1a36b02f3 100644 --- a/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json +++ b/tests/Responses/Expected/checkout/modified_cart_with_chosen_shipment_with_per_item_rate_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/order/order_details_response.json b/tests/Responses/Expected/order/order_details_response.json index 52f4f96c0..f90f5e5e9 100644 --- a/tests/Responses/Expected/order/order_details_response.json +++ b/tests/Responses/Expected/order/order_details_response.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/order/order_details_response_guest.json b/tests/Responses/Expected/order/order_details_response_guest.json index 721e0ef4f..c2c85d7f2 100644 --- a/tests/Responses/Expected/order/order_details_response_guest.json +++ b/tests/Responses/Expected/order/order_details_response_guest.json @@ -52,7 +52,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } } diff --git a/tests/Responses/Expected/order/orders_list_response.json b/tests/Responses/Expected/order/orders_list_response.json index 6e7a50a24..978a596c3 100644 --- a/tests/Responses/Expected/order/orders_list_response.json +++ b/tests/Responses/Expected/order/orders_list_response.json @@ -53,7 +53,7 @@ ], "_links": { "self": { - "href": "\/shop-api\/WEB_GB\/products\/by-slug\/logan-mug" + "href": "\/shop-api\/products\/by-slug\/logan-mug" } } }