diff --git a/composer.json b/composer.json index a9d044a6720..a0c6de4f938 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "sylius/sylius", "type": "library", - "version": "v1.8.11-dev", + "version": "v1.8.12-dev", "description": "E-Commerce platform for PHP, based on Symfony framework.", "homepage": "https://sylius.com", "license": "MIT", @@ -55,7 +55,7 @@ "swiftmailer/swiftmailer": "^6.2", "sylius-labs/association-hydrator": "^1.1", "sylius-labs/doctrine-migrations-extra-bundle": "^0.1.3", - "sylius/admin-api-bundle": "~1.8.0", + "sylius/admin-api-bundle": "~1.8.12", "sylius/fixtures-bundle": "^1.6.1", "sylius/grid": "^1.7.5", "sylius/grid-bundle": "^1.7.5", diff --git a/tests/Controller/AdminUserApiTest.php b/tests/Controller/AdminUserApiTest.php deleted file mode 100644 index bfb2fca113a..00000000000 --- a/tests/Controller/AdminUserApiTest.php +++ /dev/null @@ -1,348 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_an_admin_user_creation_for_not_authenticated_users() - { - $this->client->request('POST', '/api/v1/users/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_an_admin_user_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/users/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_an_admin_user() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/users/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_an_admin_user_with_not_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/users/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/create_with_additional_fields_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_access_to_an_admin_users_list_for_not_authenticated_user() - { - $this->client->request('GET', '/api/v1/users/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_an_admin_users_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/admin_users.yml'); - - $this->client->request('GET', '/api/v1/users/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_access_to_an_admin_user_details_for_not_authenticated_users() - { - $this->client->request('GET', '/api/v1/users/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_an_admin_user_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/users/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_shows_an_admin_user_details() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $users = $this->loadFixturesFromFile('resources/admin_users.yml'); - - $this->client->request('GET', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_an_admin_user_full_update_for_not_authenticated_users() - { - $this->client->request('PUT', '/api/v1/users/1'); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_full_update_of_an_admin_user_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/users/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_an_admin_user_fully_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $users = $this->loadFixturesFromFile('resources/admin_users.yml'); - - $this->client->request('PUT', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_an_admin_user_fully() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $users = $this->loadFixturesFromFile('resources/admin_users.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('PUT', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_partial_update_of_an_admin_user_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PATCH', '/api/v1/users/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_update_an_admin_user_partially() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $users = $this->loadFixturesFromFile('resources/admin_users.yml'); - - $data = -<<client->request('PATCH', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/partial_update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_an_admin_user_deletion_for_not_authenticated_users() - { - $this->client->request('DELETE', '/api/v1/users/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_deletion_of_an_admin_user_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/users/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_an_admin_user() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $users = $this->loadFixturesFromFile('resources/admin_users.yml'); - - $this->client->request('DELETE', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getAdminUserUrl($users['admin1']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_delete_current_logged_an_admin_user() - { - $user = $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/admin_users.yml'); - - $this->client->request('DELETE', $this->getAdminUserUrl($user['admin']), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'admin_user/deletion_fail_response', Response::HTTP_UNPROCESSABLE_ENTITY); - } - - /** - * @return string - */ - private function getAdminUserUrl(AdminUserInterface $user) - { - return '/api/v1/users/' . $user->getId(); - } -} diff --git a/tests/Controller/CartApiTest.php b/tests/Controller/CartApiTest.php deleted file mode 100644 index 2363bfa6785..00000000000 --- a/tests/Controller/CartApiTest.php +++ /dev/null @@ -1,580 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_getting_an_cart_for_non_authenticated_user() - { - $this->client->request('GET', $this->getCartApiUrl('-1')); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_an_cart_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', $this->getCartApiUrl('-1'), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $cartData = $this->loadFixturesFromFile('resources/cart.yml'); - - /** @var OrderInterface $cart */ - $cart = $cartData['order_001']; - - $this->client->request('GET', $this->getCartApiUrl((string) $cart->getId()), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_show_orders_in_state_other_than_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $orderData = $this->loadFixturesFromFile('resources/order.yml'); - - /** @var OrderInterface $cart */ - $cart = $orderData['order_001']; - - $this->client->request('GET', $this->getCartApiUrl((string) $cart->getId()), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_denies_creating_cart_for_non_authenticated_user() - { - $this->client->request('POST', $this->getCartApiUrl()); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_cart_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', $this->getCartApiUrl(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/cart.yml'); - - $data = -<<client->request('POST', $this->getCartApiUrl(), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'cart/show_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_getting_carts_for_non_authenticated_user() - { - $this->client->request('GET', $this->getCartApiUrl()); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_carts_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/cart.yml'); - - $this->client->request('GET', $this->getCartApiUrl(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_list_carts_in_state_different_than_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/order.yml'); - - $this->client->request('GET', $this->getCartApiUrl(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/empty_index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_carts_deletion_for_non_authenticated_user() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $carts = $this->loadFixturesFromFile('resources/cart.yml'); - /** @var OrderInterface $cart */ - $cart = $carts['order_001']; - - $this->client->request('DELETE', $this->getCartApiUrl((string) $cart->getId())); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_cart_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', $this->getCartApiUrl('-1'), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $carts = $this->loadFixturesFromFile('resources/cart.yml'); - - /** @var OrderInterface $cart */ - $cart = $carts['order_001']; - - $this->client->request('DELETE', $this->getCartApiUrl((string) $cart->getId()), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCartApiUrl((string) $cart->getId()), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_delete_orders_in_state_different_than_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $orders = $this->loadFixturesFromFile('resources/order.yml'); - - /** @var OrderItemInterface $order */ - $order = $orders['order_001']; - - $this->client->request('DELETE', $this->getCartApiUrl((string) $order->getId()), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_denies_adding_a_product_to_cart_for_non_authenticated_user() - { - $this->client->request('POST', $this->getCartApiUrl('1/items/')); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_add_item_to_cart_without_providing_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $carts = $this->loadFixturesFromFile('resources/cart.yml'); - - /** @var OrderInterface $cart */ - $cart = $carts['order_001']; - - $this->client->request('POST', $this->getCartItemListUrl($cart), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/add_to_cart_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_adds_an_item_to_the_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $carts = $this->loadFixturesFromFile('resources/cart.yml'); - - /** @var OrderInterface $cart */ - $cart = $carts['order_001']; - - $data = -<<client->request('POST', $this->getCartItemListUrl($cart), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/add_to_cart_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allow_to_add_item_with_negative_quantity() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $carts = $this->loadFixturesFromFile('resources/cart.yml'); - - /** @var OrderInterface $cart */ - $cart = $carts['order_001']; - - $data = -<<client->request('POST', $this->getCartItemListUrl($cart), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/add_to_cart_quantity_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_adds_an_item_to_the_cart_with_quantity_bigger_than_one() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $carts = $this->loadFixturesFromFile('resources/cart.yml'); - - /** @var OrderInterface $cart */ - $cart = $carts['order_001']; - - $data = -<<client->request('POST', $this->getCartItemListUrl($cart), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/add_to_cart_with_bigger_quantity_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_adds_an_item_with_tracked_variant_to_the_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $carts = $this->loadFixturesFromFile('resources/cart.yml'); - - /** @var OrderInterface $cart */ - $cart = $carts['order_001']; - - $data = -<<client->request('POST', $this->getCartItemListUrl($cart), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/add_to_cart_hard_available_item_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_checks_if_requested_variant_is_available() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $carts = $this->loadFixturesFromFile('resources/cart.yml'); - - /** @var OrderInterface $cart */ - $cart = $carts['order_001']; - - $data = -<<client->request('POST', $this->getCartItemListUrl($cart), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/add_to_cart_hard_available_item_validation_error_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_denies_updating_a_cart_item_quantity_for_non_authenticated_user() - { - $this->client->request('PUT', $this->getCartApiUrl('1/items/1')); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_items_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $cartWithItems = $this->loadFixturesFromFile('resources/cart_with_items.yml'); - - /** @var OrderInterface $cart */ - $cart = $cartWithItems['cart_with_items']; - /** @var OrderItemInterface $cartItem */ - $cartItem = $cartWithItems['sw_mug_item']; - - $data = -<<client->request('PUT', $this->getCartItemUrl($cart, $cartItem), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/update_cart_item_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_updates_item_quantity() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $cartWithItems = $this->loadFixturesFromFile('resources/cart_with_items.yml'); - - /** @var OrderInterface $cart */ - $cart = $cartWithItems['cart_with_items']; - /** @var OrderItemInterface $cartItem */ - $cartItem = $cartWithItems['sw_mug_item']; - - $data = -<<client->request('PUT', $this->getCartItemUrl($cart, $cartItem), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCartApiUrl((string) $cart->getId()), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/increase_quantity_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_checks_if_requested_variant_is_available_during_quantity_update() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $cartWithItems = $this->loadFixturesFromFile('resources/cart_with_items.yml'); - - /** @var OrderInterface $cart */ - $cart = $cartWithItems['cart_with_items']; - /** @var OrderItemInterface $cartItem */ - $cartItem = $cartWithItems['hard_available_mug_item']; - - $data = -<<client->request('PUT', $this->getCartItemUrl($cart, $cartItem), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/update_hard_available_cart_item_validation_error_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_denies_carts_item_deletion_for_non_authenticated_user() - { - $this->client->request('DELETE', $this->getCartApiUrl('-1/items/-1')); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_cart_item_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $cartWithItems = $this->loadFixturesFromFile('resources/cart_with_items.yml'); - - /** @var OrderInterface $cart */ - $cart = $cartWithItems['cart_with_items']; - $url = sprintf($this->getCartApiUrl('%s/items/-1'), $cart->getId()); - - $this->client->request('DELETE', $url, [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_cart_item() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $cartWithItems = $this->loadFixturesFromFile('resources/cart_with_items.yml'); - - /** @var OrderInterface $cart */ - $cart = $cartWithItems['cart_with_items']; - /** @var OrderItemInterface $cartItem */ - $cartItem = $cartWithItems['hard_available_mug_item']; - - $this->client->request('DELETE', $this->getCartItemUrl($cart, $cartItem), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_resets_totals_if_cart_item_was_removed() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $cartWithItems = $this->loadFixturesFromFile('resources/cart_with_items.yml'); - - /** @var OrderInterface $cart */ - $cart = $cartWithItems['cart_with_items']; - /** @var OrderItemInterface $cartItem */ - $cartItem = $cartWithItems['hard_available_mug_item']; - - $this->client->request('DELETE', $this->getCartItemUrl($cart, $cartItem), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCartApiUrl((string) $cart->getId()), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'cart/recalculated_items_total_response', Response::HTTP_OK); - } - - private function getCartApiUrl(string $urlFragment = ''): string - { - return '/api/v1/carts/' . $urlFragment; - } - - /** - * @return string - */ - private function getCartItemListUrl(OrderInterface $cart) - { - return sprintf($this->getCartApiUrl('%s/items/'), (string) $cart->getId()); - } - - /** - * @return string - */ - private function getCartItemUrl(OrderInterface $cart, OrderItemInterface $cartItem) - { - return sprintf($this->getCartApiUrl('%s/items/%s'), $cart->getId(), $cartItem->getId()); - } -} diff --git a/tests/Controller/ChannelApiTest.php b/tests/Controller/ChannelApiTest.php deleted file mode 100644 index 937c0829bb4..00000000000 --- a/tests/Controller/ChannelApiTest.php +++ /dev/null @@ -1,335 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithContentType = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_channels_list_when_access_is_denied(): void - { - $this->loadFixturesFromFile('resources/channels.yml'); - - $this->client->request('GET', '/api/v1/channels/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_denies_creating_channels_for_non_authenticated_user(): void - { - $this->client->request('POST', '/api/v1/channels/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_channel_without_specifying_required_data(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/channels/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'channel/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_indexing_channels(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/channels.yml'); - - $this->client->request('GET', '/api/v1/channels/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'channel/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_channel_for_non_authenticated_user(): void - { - $this->client->request('GET', '/api/v1/channels/none'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_channel_when_it_does_not_exist(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/channels/none', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_create_channel_with_required_data(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $this->loadFixturesFromFile('resources/currencies.yml'); - - $data = - <<client->request('POST', '/api/v1/channels/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'channel/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_channel_with_extra_data(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $this->loadFixturesFromFile('resources/currencies.yml'); - $this->loadFixturesFromFile('resources/zones.yml'); - $this->loadFixturesFromFile('resources/taxons.yml'); - - $data = -<<client->request('POST', '/api/v1/channels/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'channel/create_with_extra_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_updating_channel_for_non_authenticated_user(): void - { - $this->client->request('PUT', '/api/v1/channels/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_channel_without_specifying_required_data(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $channels = $this->loadFixturesFromFile('resources/channels.yml'); - - /** @var ChannelInterface $channel */ - $channel = $channels['channel_web']; - - $this->client->request('PUT', $this->getChannelUrl($channel), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'channel/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_channel(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $channels = $this->loadFixturesFromFile('resources/channels.yml'); - - /** @var ChannelInterface $channel */ - $channel = $channels['channel_web']; - - $data = - <<client->request('PUT', $this->getChannelUrl($channel), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getChannelUrl($channel), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'channel/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_showing_channel(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $channels = $this->loadFixturesFromFile('resources/channels.yml'); - /** @var ChannelInterface $channel */ - $channel = $channels['channel_web']; - - $this->client->request('GET', $this->getChannelUrl($channel), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'channel/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_partially_updating_channel_which_does_not_exist(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PATCH', '/api/v1/channels/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_partially_update_channel(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $channels = $this->loadFixturesFromFile('resources/channels.yml'); - - /** @var ChannelInterface $channel */ - $channel = $channels['channel_web']; - - $data = - <<client->request('PATCH', $this->getChannelUrl($channel), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getChannelUrl($channel), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'channel/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_delete_non_existing_channel(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/channels/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_channel(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $channels = $this->loadFixturesFromFile('resources/channels.yml'); - $channel = $channels['channel-mob']; - - $this->client->request('DELETE', $this->getChannelUrl($channel), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getChannelUrl($channel), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - private function getChannelUrl(ChannelInterface $channel): string - { - return '/api/v1/channels/' . $channel->getCode(); - } -} diff --git a/tests/Controller/CheckoutAddressingApiTest.php b/tests/Controller/CheckoutAddressingApiTest.php deleted file mode 100644 index 6f64bed35e5..00000000000 --- a/tests/Controller/CheckoutAddressingApiTest.php +++ /dev/null @@ -1,426 +0,0 @@ -client->request('PUT', '/api/v1/checkouts/addressing/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_address_unexisting_order() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/checkouts/addressing/1', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_address_order_without_specifying_shipping_address() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $data = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/addressing_validation_failed_shipping_address', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_address_order_with_the_same_shipping_and_billing_address() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $data = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - * - * It is a test for deprecated behaviour since Sylius 1.7 and will be removed in Sylius 2.0 - */ - public function it_allows_to_address_order_with_the_same_shipping_and_billing_address_using_different_billing_address_flag(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $data = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_does_not_allow_to_address_order_with_different_addresses_if_billing_address_is_not_defined() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $this->loadFixturesFromFile('resources/customers.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $data = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/addressing_validation_failed_billing_address', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_address_order_with_different_shipping_and_billing_address() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $data = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCheckoutSummaryUrl($cartId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/addressed_order_response'); - } - - /** - * @test - * - * It is a test for deprecated behaviour since Sylius 1.7 and will be removed in Sylius 2.0 - */ - public function it_allows_to_address_order_with_different_shipping_and_billing_address_using_different_billing_address_flag(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $data = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCheckoutSummaryUrl($cartId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/addressed_order_response'); - } - - /** - * @test - */ - public function it_allows_to_change_order_address_after_the_order_has_already_been_addressed() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $data = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $newData = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $newData); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_to_change_order_address_after_selecting_shipping_method() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $addressData = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $addressData); - - $this->selectOrderShippingMethod($cartId); - - $newAddressData = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $newAddressData); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_to_change_order_address_after_selecting_payment_method() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $addressData = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $addressData); - - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - - $newAddressData = -<<client->request('PUT', $this->getAddressingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $newAddressData); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @return string - */ - private function getAddressingUrl($cartId) - { - return sprintf('/api/v1/checkouts/addressing/%d', $cartId); - } -} diff --git a/tests/Controller/CheckoutApiTestCase.php b/tests/Controller/CheckoutApiTestCase.php deleted file mode 100644 index 27c5920dddf..00000000000 --- a/tests/Controller/CheckoutApiTestCase.php +++ /dev/null @@ -1,175 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - protected static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - protected function createCart() - { - $data = -<<client->request('POST', '/api/v1/carts/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_CREATED); - $rawResponse = json_decode($response->getContent(), true); - - return $rawResponse['id']; - } - - protected function addItemToCart($cartId) - { - $url = sprintf('/api/v1/carts/%d/items/', $cartId); - - $data = -<<client->request('POST', $url, [], [], static::$authorizedHeaderWithContentType, $data); - $this->assertResponseCode($this->client->getResponse(), Response::HTTP_CREATED); - } - - protected function addressOrder($cartId) - { - $this->loadFixturesFromFile('resources/countries.yml'); - - $data = -<<client->request('PUT', $url, [], [], static::$authorizedHeaderWithContentType, $data); - $this->assertResponseCode($this->client->getResponse(), Response::HTTP_NO_CONTENT); - } - - protected function selectOrderShippingMethod($cartId) - { - $url = sprintf('/api/v1/checkouts/select-shipping/%d', $cartId); - - $this->client->request('GET', $url, [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $data = -<<client->request('PUT', $url, [], [], static::$authorizedHeaderWithContentType, $data); - $this->assertResponseCode($this->client->getResponse(), Response::HTTP_NO_CONTENT); - } - - protected function selectOrderPaymentMethod($cartId) - { - $url = sprintf('/api/v1/checkouts/select-payment/%d', $cartId); - - $this->client->request('GET', $url, [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $data = -<<client->request('PUT', $url, [], [], static::$authorizedHeaderWithContentType, $data); - $this->assertResponseCode($this->client->getResponse(), Response::HTTP_NO_CONTENT); - } - - protected function completeOrder($cartId) - { - $this->client->request('PUT', sprintf('/api/v1/checkouts/complete/%d', $cartId), [], [], static::$authorizedHeaderWithContentType); - $this->assertResponseCode($this->client->getResponse(), Response::HTTP_NO_CONTENT); - } - - protected function prepareOrder() - { - $cartId = $this->createCart(); - - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - $this->completeOrder($cartId); - - return $cartId; - } - - /** - * @return string - */ - protected function getCheckoutSummaryUrl($cartId) - { - return sprintf('/api/v1/checkouts/%d', $cartId); - } -} diff --git a/tests/Controller/CheckoutCompleteApiTest.php b/tests/Controller/CheckoutCompleteApiTest.php deleted file mode 100644 index 043b7e1945d..00000000000 --- a/tests/Controller/CheckoutCompleteApiTest.php +++ /dev/null @@ -1,198 +0,0 @@ -client->request('PUT', '/api/v1/checkouts/complete/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_complete_unexisting_order() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/checkouts/complete/1', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_complete_order_that_is_not_addressed_and_has_no_shipping_and_payment_method_selected() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - - $this->client->request('PUT', $this->getCheckoutCompleteUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/complete_invalid_order_state', Response::HTTP_INTERNAL_SERVER_ERROR); - } - - /** - * @test - */ - public function it_does_not_allow_to_complete_order_with_disabled_product() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - - /** @var ProductRepositoryInterface $productRepository */ - $productRepository = $this->client->getContainer()->get('sylius.repository.product'); - /** @var ProductInterface $product */ - $product = $productRepository->findOneBy(['code' => 'MUG']); - $this->assertNotNull($product); - $product->disable(); - - /** @var EntityManagerInterface $productManager */ - $productManager = $this->client->getContainer()->get('sylius.manager.product'); - $productManager->persist($product); - $productManager->flush(); - - $this->client->request('PUT', $this->getCheckoutCompleteUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/complete_validation_failed_disabled_product', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_allow_to_complete_order_with_insufficient_stock() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - - /** @var ProductVariantRepositoryInterface $productVariantRepository */ - $productVariantRepository = $this->client->getContainer()->get('sylius.repository.product_variant'); - /** @var ProductVariant $productVariant */ - $productVariant = $productVariantRepository->findOneByCodeAndProductCode('MUG_SW', 'MUG'); - $this->assertNotNull($productVariant); - $productVariant->setTracked(true); - $productVariant->setOnHand(0); - $productVariant->setOnHold(0); - - /** @var EntityManagerInterface $productVariantManager */ - $productVariantManager = $this->client->getContainer()->get('sylius.manager.product_variant'); - $productVariantManager->persist($productVariant); - $productVariantManager->flush(); - - $this->client->request('PUT', $this->getCheckoutCompleteUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/complete_validation_failed_insufficient_stock', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_complete_order_that_is_addressed_and_has_shipping_and_payment_method_selected() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - - $this->client->request('PUT', $this->getCheckoutCompleteUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCheckoutSummaryUrl($cartId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/completed_order_response'); - } - - /** - * @test - */ - public function it_allows_to_add_a_note_to_order_when_completing() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - - $data = -<<client->request('PUT', $this->getCheckoutCompleteUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCheckoutSummaryUrl($cartId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/completed_order_response'); - } - - /** - * @return string - */ - private function getCheckoutCompleteUrl($cartId) - { - return sprintf('/api/v1/checkouts/complete/%d', $cartId); - } -} diff --git a/tests/Controller/CheckoutPaymentApiTest.php b/tests/Controller/CheckoutPaymentApiTest.php deleted file mode 100644 index be2ca853468..00000000000 --- a/tests/Controller/CheckoutPaymentApiTest.php +++ /dev/null @@ -1,231 +0,0 @@ -client->request('PUT', '/api/v1/checkouts/select-payment/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_select_payment_for_unexisting_order() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/checkouts/select-payment/1', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_select_payment_for_order_that_is_not_addressed_and_has_no_shipping_method_selected() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - - $this->client->request('PATCH', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/payment_invalid_order_state', Response::HTTP_INTERNAL_SERVER_ERROR); - } - - /** - * @test - */ - public function it_does_not_allow_to_select_unexisting_payment_method() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - - $data = -<<client->request('PUT', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'checkout/payment_validation_failed', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_provides_details_about_available_payment_methods() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - - $this->client->request('GET', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/get_available_payment_methods', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_provide_details_about_available_payment_methods_before_addressing() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $this->client->request('GET', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/get_available_payment_methods_failed', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_provide_details_about_available_payment_methods_before_choosing_shipping_method() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - - $this->client->request('GET', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/get_available_payment_methods_failed', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_select_payment_method_for_order() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - - $this->client->request('GET', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $data = -<<client->request('PUT', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCheckoutSummaryUrl($cartId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/payment_selected_order_response'); - } - - /** - * @test - */ - public function it_allows_to_change_payment_method_after_its_already_been_chosen() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - - $this->client->request('GET', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $data = -<<client->request('PUT', $this->getSelectPaymentUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @return string - */ - private function getSelectPaymentUrl($cartId) - { - return sprintf('/api/v1/checkouts/select-payment/%d', $cartId); - } -} diff --git a/tests/Controller/CheckoutShippingApiTest.php b/tests/Controller/CheckoutShippingApiTest.php deleted file mode 100644 index 2939c263e2d..00000000000 --- a/tests/Controller/CheckoutShippingApiTest.php +++ /dev/null @@ -1,273 +0,0 @@ -client->request('PUT', '/api/v1/checkouts/select-shipping/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_select_shipping_for_unexisting_order() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/checkouts/select-shipping/1', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_select_shipping_for_order_that_is_not_addressed() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $this->client->request('PUT', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/shipping_invalid_order_state', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_allow_to_select_shipping_for_order_without_specifying_shipping_method() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - - $this->client->request('PUT', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/shipping_invalid_order_state', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_provide_details_of_unexisting_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/checkouts/select-shipping/0', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_provides_details_about_available_shipping_method() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - - $this->client->request('GET', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/get_available_shipping_methods', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_provide_details_about_available_shipping_method_before_addressing() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $this->client->request('GET', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/get_available_shipping_methods_failed', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_allow_to_select_unexisting_shipping_method() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - - $data = -<<client->request('PUT', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/shipping_validation_failed', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_select_shipping_method_for_order() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - - $this->client->request('GET', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $data = -<<client->request('PUT', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCheckoutSummaryUrl($cartId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'checkout/shipping_selected_order_response'); - } - - /** - * @test - */ - public function it_allows_to_change_order_shipping_method_after_its_already_been_chosen() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - - $this->client->request('GET', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $data = -<<client->request('PUT', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_to_change_order_shipping_method_after_selecting_payment_method() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - - $this->client->request('GET', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $data = -<<client->request('PUT', $this->getSelectShippingUrl($cartId), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @return string - */ - private function getSelectShippingUrl($cartId) - { - return sprintf('/api/v1/checkouts/select-shipping/%d', $cartId); - } -} diff --git a/tests/Controller/CountryApiTest.php b/tests/Controller/CountryApiTest.php deleted file mode 100644 index 5b6700940c3..00000000000 --- a/tests/Controller/CountryApiTest.php +++ /dev/null @@ -1,198 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_creating_country_for_non_authenticated_user() - { - $this->client->request('POST', '/api/v1/countries/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_country_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/countries/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'country/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_country_with_given_code() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/countries/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'country/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_country_with_provinces() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/countries/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'country/create_with_province_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_country_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/countries/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_countries_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - - $this->client->request('GET', '/api/v1/countries/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'country/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_country() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $countries = $this->loadFixturesFromFile('resources/countries.yml'); - $country = $countries['country_NL']; - - $this->client->request('GET', $this->getCountryUrl($country), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'country/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_country_for_non_authenticated_user() - { - $this->loadFixturesFromFile('resources/countries.yml'); - $this->client->request('GET', '/api/v1/countries/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_country_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/countries/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_country() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $countries = $this->loadFixturesFromFile('resources/countries.yml'); - $country = $countries['country_NL']; - - $this->client->request('DELETE', $this->getCountryUrl($country), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCountryUrl($country), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @return string - */ - private function getCountryUrl(CountryInterface $country) - { - return '/api/v1/countries/' . $country->getCode(); - } -} diff --git a/tests/Controller/CurrencyApiTest.php b/tests/Controller/CurrencyApiTest.php deleted file mode 100644 index 72f033c03db..00000000000 --- a/tests/Controller/CurrencyApiTest.php +++ /dev/null @@ -1,188 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]; - - /** @var array */ - private static $authorizedHeaderWithContentType = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_creating_currency_for_non_authenticated_user() - { - $this->client->request('POST', '/api/v1/currencies/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_currency_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/currencies/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'currency/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_currency_with_given_code() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/currencies/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'currency/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_getting_currencies_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/currencies/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_currencies_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/currencies.yml'); - - $this->client->request('GET', '/api/v1/currencies/', [], [], static::$authorizedHeader); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'currency/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_currency_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/currencies/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_currency_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/currencies/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_currency() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); - $currency = $currencies['currency_1']; - - $this->client->request('GET', $this->getCurrencyUrl($currency), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'currency/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_currency_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/currencies/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_currency() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $currencies = $this->loadFixturesFromFile('resources/currencies.yml'); - $currency = $currencies['currency_1']; - - $this->client->request('DELETE', $this->getCurrencyUrl($currency), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getCurrencyUrl($currency), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @return string - */ - private function getCurrencyUrl(CurrencyInterface $currency) - { - return '/api/v1/currencies/' . $currency->getCode(); - } -} diff --git a/tests/Controller/CustomerApiTest.php b/tests/Controller/CustomerApiTest.php deleted file mode 100644 index 9a8457e4708..00000000000 --- a/tests/Controller/CustomerApiTest.php +++ /dev/null @@ -1,368 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_customer_creation_for_not_authenticated_users() - { - $this->client->request('POST', '/api/v1/customers/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_customer_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/customers/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_customer_with_user_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/customers/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/create_with_user_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_customer_without_user_account() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/customers/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_customer_with_user_account() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/customers/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/create_with_user_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_access_to_customers_list_for_not_authenticated_users() - { - $this->client->request('GET', '/api/v1/customers/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_customers_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/customers.yml'); - - $this->client->request('GET', '/api/v1/customers/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_returns_page_not_found_if_limit_is_set_to_0() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/customers.yml'); - - $this->client->request('GET', '/api/v1/customers/?limit=0', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/page_not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_denies_access_to_customer_details_for_not_authenticated_users() - { - $this->client->request('GET', '/api/v1/customers/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_customer_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/customers/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_returns_only_customer_details_if_no_user_account_is_connected() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $customers = $this->loadFixturesFromFile('resources/customers.yml'); - - $this->client->request('GET', '/api/v1/customers/' . $customers['customer_Barry']->getId(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_shows_customer_and_user_details() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $customers = $this->loadFixturesFromFile('resources/customers.yml'); - - $this->client->request('GET', '/api/v1/customers/' . $customers['customer_Roy']->getId(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/show_with_user_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_full_customer_update_for_not_authenticated_users() - { - $this->client->request('PUT', '/api/v1/customers/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_full_update_of_a_customer_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/customers/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_customer_fully_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $customers = $this->loadFixturesFromFile('resources/customers.yml'); - - $this->client->request('PUT', '/api/v1/customers/' . $customers['customer_Oliver']->getId(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_customer_fully() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $customers = $this->loadFixturesFromFile('resources/customers.yml'); - - $data = -<<client->request('PUT', '/api/v1/customers/' . $customers['customer_Oliver']->getId(), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/customers/' . $customers['customer_Oliver']->getId(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_partial_update_of_a_customer_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PATCH', '/api/v1/customers/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_update_customer_partially() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $customers = $this->loadFixturesFromFile('resources/customers.yml'); - - $data = -<<client->request('PATCH', '/api/v1/customers/' . $customers['customer_Oliver']->getId(), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/customers/' . $customers['customer_Oliver']->getId(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'customer/partial_update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_customer_deletion_for_not_authenticated_users() - { - $this->client->request('DELETE', '/api/v1/customers/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_deletion_of_a_customer_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/customers/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_customer() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $customers = $this->loadFixturesFromFile('resources/customers.yml'); - - $this->client->request('DELETE', '/api/v1/customers/' . $customers['customer_Oliver']->getId(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/customers/' . $customers['customer_Oliver']->getId(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } -} diff --git a/tests/Controller/ExchangeRateApiTest.php b/tests/Controller/ExchangeRateApiTest.php deleted file mode 100644 index 4bd65ff3ffc..00000000000 --- a/tests/Controller/ExchangeRateApiTest.php +++ /dev/null @@ -1,337 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'Accept' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_creating_exchange_rate_for_non_authenticated_user() - { - $this->client->request('POST', '/api/v1/exchange-rates/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_exchange_rate_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/exchange-rates/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_exchange_rate() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/currencies.yml'); - - $data = -<<client->request('POST', '/api/v1/exchange-rates/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_exchange_rate_with_duplicated_currency_pair() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/exchange_rates.yml'); - - $data = -<<client->request('POST', '/api/v1/exchange-rates/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/non_unique_pair_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_denies_getting_exchange_rates_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/exchange-rates/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_exchange_rates_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/exchange_rates.yml'); - - $this->client->request('GET', '/api/v1/exchange-rates/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_exchange_rate_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/exchange-rates/EUR-USD'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_exchange_rate_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/exchange-rates/EUR-USD', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_exchange_rate() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $exchangeRates = $this->loadFixturesFromFile('resources/exchange_rates.yml'); - - /** @var ExchangeRateInterface $exchangeRate */ - $exchangeRate = $exchangeRates['eur_gbp_exchange_rate']; - - $this->client->request('GET', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_updating_exchange_rate_for_non_authenticated_user() - { - $this->client->request('PUT', '/api/v1/exchange-rates/EUR-USD'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_updating_exchange_rate_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/exchange-rates/EUR-USD', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_exchange_rate_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $exchangeRates = $this->loadFixturesFromFile('resources/exchange_rates.yml'); - - /** @var ExchangeRateInterface $exchangeRate */ - $exchangeRate = $exchangeRates['eur_usd_exchange_rate']; - - $this->client->request('PUT', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_exchange_rate() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $exchangeRates = $this->loadFixturesFromFile('resources/exchange_rates.yml'); - - /** @var ExchangeRateInterface $exchangeRate */ - $exchangeRate = $exchangeRates['eur_usd_exchange_rate']; - - $data = -<<client->request('PUT', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_exchange_rates_currencies() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $exchangeRates = $this->loadFixturesFromFile('resources/exchange_rates.yml'); - - /** @var ExchangeRateInterface $exchangeRate */ - $exchangeRate = $exchangeRates['eur_usd_exchange_rate']; - - $data = -<<client->request('PATCH', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_exchange_rate_if_ratio_is_not_a_number() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $exchangeRates = $this->loadFixturesFromFile('resources/exchange_rates.yml'); - - /** @var ExchangeRateInterface $exchangeRate */ - $exchangeRate = $exchangeRates['eur_usd_exchange_rate']; - - $data = -<<client->request('PUT', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'exchange_rate/update_ratio_with_string_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_exchange_rate_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/exchange-rates/EUR-USD', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_exchange_rate() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $exchangeRates = $this->loadFixturesFromFile('resources/exchange_rates.yml'); - - /** @var ExchangeRateInterface $exchangeRate */ - $exchangeRate = $exchangeRates['eur_gbp_exchange_rate']; - - $this->client->request('DELETE', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getExchangeRateUrl($exchangeRate), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @return string - */ - private function getExchangeRateUrl(ExchangeRateInterface $exchangeRate) - { - return sprintf('/api/v1/exchange-rates/%s-%s', $exchangeRate->getSourceCurrency()->getCode(), $exchangeRate->getTargetCurrency()->getCode()); - } -} diff --git a/tests/Controller/LocaleApiTest.php b/tests/Controller/LocaleApiTest.php deleted file mode 100644 index 5317ebaadbc..00000000000 --- a/tests/Controller/LocaleApiTest.php +++ /dev/null @@ -1,163 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_getting_locales_for_non_authenticated_user() - { - $this->client->request('POST', '/api/v1/locales/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_locales_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $this->client->request('GET', '/api/v1/locales/', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'locale/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_locale() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $locales = $this->loadFixturesFromFile('resources/locales.yml'); - - $this->client->request('GET', '/api/v1/locales/' . $locales['locale_en_US']->getCode(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'locale/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_locale_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/locales/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'locale/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_locale_with_given_code() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/locales/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'locale/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_getting_locale_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/locales/en'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_locale_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/locales/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_locale_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/locales/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_locale() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $locales = $this->loadFixturesFromFile('resources/locales.yml'); - - $this->client->request('DELETE', '/api/v1/locales/' . $locales['locale_en_US']->getCode(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/locales/' . $locales['locale_en_US']->getId(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } -} diff --git a/tests/Controller/OauthTokenApiTest.php b/tests/Controller/OauthTokenApiTest.php deleted file mode 100644 index 70e62d8b5aa..00000000000 --- a/tests/Controller/OauthTokenApiTest.php +++ /dev/null @@ -1,67 +0,0 @@ -loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/oauth/v2/token', [], [], ['CONTENT_TYPE' => 'application/json'], $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/new_access_token', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_refresh_an_access_token() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/oauth/v2/token', [], [], ['CONTENT_TYPE' => 'application/json'], $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/new_access_token', Response::HTTP_OK); - } -} diff --git a/tests/Controller/OrderApiTest.php b/tests/Controller/OrderApiTest.php deleted file mode 100644 index 3cf66d49656..00000000000 --- a/tests/Controller/OrderApiTest.php +++ /dev/null @@ -1,432 +0,0 @@ -client->request('GET', '/api/v1/orders/'); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_orders_list_without_cart_state() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/orders.yml'); - - $this->client->request('GET', $this->getOrderUrl(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_an_order_for_non_authenticated_user() - { - $this->client->request('GET', $this->getOrderUrl(-1)); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_an_order_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', $this->getOrderUrl(-1), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_cart() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $cartId = $this->createCart(); - $this->addItemToCart($cartId); - - $this->client->request('GET', $this->getOrderUrl($cartId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/cart_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_an_order() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $orderId = $this->prepareOrder(); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_an_order_with_promotion() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - 'resources/checkout_promotion.yml', - ]); - - $orderId = $this->prepareOrder(); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_with_promotion_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_an_order_with_coupon_based_promotion() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - 'resources/checkout_coupon_based_promotion.yml', - ]); - - $cartId = $this->createCart(); - - $this->addItemToCart($cartId); - - $this->client->request('PATCH', '/api/v1/carts/' . $cartId, [], [], static::$authorizedHeaderWithAccept, '{"promotionCoupon": "BANANAS"}'); - - $this->addressOrder($cartId); - $this->selectOrderShippingMethod($cartId); - $this->selectOrderPaymentMethod($cartId); - $this->completeOrder($cartId); - - $this->client->request('GET', $this->getOrderUrl($cartId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_with_coupon_based_promotion_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_canceling_an_order_for_non_authenticated_user() - { - $this->client->request('PUT', $this->getCancelUrl(-1)); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_canceling_an_order_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', $this->getCancelUrl(-1), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_cancel_an_order() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - ]); - - $orderId = $this->prepareOrder(); - - $this->client->request('PUT', $this->getCancelUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_canceled_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_shipping_an_order_for_non_authenticated_user() - { - $this->client->request('PUT', $this->getShipOrderShipmentUrl(-1, -1)); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_ship_an_order_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', $this->getShipOrderShipmentUrl(-1, -1), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_shipping_does_not_exist_for_the_order() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - ]); - - $orderId = $this->prepareOrder(); - - $this->client->request('PUT', $this->getShipOrderShipmentUrl($orderId, -1), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_ship_an_order() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - ]); - - $orderId = $this->prepareOrder(); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $this->client->request('PUT', $this->getShipOrderShipmentUrl($orderId, $rawResponse['shipments'][0]['id']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_shipped_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_ship_an_order_with_shipment_code() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - ]); - - $orderId = $this->prepareOrder(); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $data = -<<client->request('PUT', $this->getShipOrderShipmentUrl($orderId, $rawResponse['shipments'][0]['id']), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_shipped_with_tracking_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_completing_the_payment_for_the_order_for_non_authenticated_user() - { - $this->client->request('PUT', $this->getCompleteOrderPaymentUrl(-1, -1)); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_completing_the_payment_for_the_order_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', $this->getShipOrderShipmentUrl(-1, -1), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_completing_payment_does_not_exist_for_the_order() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - ]); - - $orderId = $this->prepareOrder(); - - $this->client->request('PUT', $this->getCompleteOrderPaymentUrl($orderId, -1), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_complete_the_payment_for_the_order() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - ]); - - $orderId = $this->prepareOrder(); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $this->client->request('PUT', $this->getCompleteOrderPaymentUrl($orderId, $rawResponse['payments'][0]['id']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_payed_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_complete_the_payment_and_ship_the_order() - { - $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/checkout.yml', - ]); - - $orderId = $this->prepareOrder(); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $this->client->request('PUT', $this->getShipOrderShipmentUrl($orderId, $rawResponse['shipments'][0]['id']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('PUT', $this->getCompleteOrderPaymentUrl($orderId, $rawResponse['payments'][0]['id']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'order/order_fulfilled_show_response', Response::HTTP_OK); - } - - private function getOrderUrl(?int $orderId = null): string - { - return '/api/v1/orders/' . (string) $orderId; - } - - /** - * @return string - */ - private function getShipOrderShipmentUrl($orderId, $shipmentId) - { - return sprintf('%s/shipments/%s/ship', $this->getOrderUrl($orderId), $shipmentId); - } - - /** - * @return string - */ - private function getCompleteOrderPaymentUrl($orderId, $paymentId) - { - return sprintf('%s/payments/%s/complete', $this->getOrderUrl($orderId), $paymentId); - } - - /** - * @return string - */ - private function getCancelUrl($orderId) - { - return $this->getOrderUrl($orderId) . '/cancel'; - } -} diff --git a/tests/Controller/PaymentApiTest.php b/tests/Controller/PaymentApiTest.php deleted file mode 100644 index 0e3b69634b8..00000000000 --- a/tests/Controller/PaymentApiTest.php +++ /dev/null @@ -1,107 +0,0 @@ -client->request('GET', $this->getPaymentUrl(-1)); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_payment_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', $this->getPaymentUrl(-1), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_payment() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $orderId = $this->prepareOrder(); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $this->client->request('GET', $this->getPaymentUrl($rawResponse['payments'][0]['id']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'payment/payment_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_a_collection_of_payments_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/payments/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_a_collection_of_payments() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $this->prepareOrder(); - - $this->client->request('GET', '/api/v1/payments/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'payment/payment_index_response', Response::HTTP_OK); - } - - /** - * @return string - */ - private function getOrderUrl($orderId) - { - return '/api/v1/orders/' . $orderId; - } - - /** - * @return string - */ - private function getPaymentUrl($paymentId) - { - return '/api/v1/payments/' . $paymentId; - } -} diff --git a/tests/Controller/PaymentMethodApiTest.php b/tests/Controller/PaymentMethodApiTest.php deleted file mode 100644 index 369963223da..00000000000 --- a/tests/Controller/PaymentMethodApiTest.php +++ /dev/null @@ -1,79 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_getting_payment_method_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/payment-methods/none'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_payment_method_when_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/payment-methods/none', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_showing_payment_method() - { - $paymentMethods = $this->loadFixturesFromFiles([ - 'authentication/api_administrator.yml', - 'resources/channels.yml', - 'resources/payment_methods.yml', - ]); - - /** @var PaymentMethodInterface $paymentMethod */ - $paymentMethod = $paymentMethods['cash_on_delivery']; - - $this->client->request('GET', $this->getPaymentMethodUrl($paymentMethod), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'payment_method/show_response', Response::HTTP_OK); - } - - /** - * @return string - */ - private function getPaymentMethodUrl(PaymentMethodInterface $paymentMethod) - { - return '/api/v1/payment-methods/' . $paymentMethod->getCode(); - } -} diff --git a/tests/Controller/ProductApiTest.php b/tests/Controller/ProductApiTest.php deleted file mode 100644 index a6fa0b20547..00000000000 --- a/tests/Controller/ProductApiTest.php +++ /dev/null @@ -1,559 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_products_list_when_access_is_denied() - { - $this->loadFixturesFromFile('resources/products.yml'); - $this->client->request('GET', '/api/v1/products/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_product_when_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/products/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_indexing_products() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/products.yml'); - $this->loadFixturesFromFile('resources/many_products.yml'); - - $this->client->request('GET', '/api/v1/products/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_showing_product() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $products = $this->loadFixturesFromFile('resources/products.yml'); - $product = $products['product1']; - - $this->client->request('GET', $this->getProductUrl($product), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_delete_product_if_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/products/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_delete_product() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $products = $this->loadFixturesFromFile('resources/products.yml'); - $product = $products['product1']; - - $this->client->request('DELETE', $this->getProductUrl($product), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - $product = $products['product1']; - - $this->client->request('GET', $this->getProductUrl($product), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_create_product_with_multiple_translations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_product_with_too_long_translations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $longString = str_repeat('s', 256); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_long_translations_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_product_without_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_updating_product() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $products = $this->loadFixturesFromFile('resources/products.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $product = $products['product3']; - - $data = -<<client->request('PUT', $this->getProductUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_updating_partial_information_about_product() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $products = $this->loadFixturesFromFile('resources/products.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $product = $products['product1']; - - $data = -<<client->request('PATCH', $this->getProductUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_paginating_the_index_of_products() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/products.yml'); - $this->loadFixturesFromFile('resources/many_products.yml'); - - $this->client->request('GET', '/api/v1/products/', ['page' => 2], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/paginated_index_response'); - } - - /** - * @test - */ - public function it_allows_sorting_the_index_of_products() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/products.yml'); - $this->loadFixturesFromFile('resources/many_products.yml'); - - $this->client->request('GET', '/api/v1/products/', ['sorting' => ['code' => 'asc']], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/sorted_index_response'); - } - - /** - * @test - */ - public function it_allows_creating_product_with_options() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/product_options.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_options_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_product_with_main_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/taxons.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_main_taxon_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_product_with_product_taxons() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $this->loadFixturesFromFile('resources/taxons.yml'); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_product_taxons_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_product_with_channels() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/channels.yml'); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_channels_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_product_with_attributes() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $this->loadFixturesFromFile('resources/product_attributes.yml'); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_attributes_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_product_with_select_attribute() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $this->loadFixturesFromFile('resources/product_attributes.yml'); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_select_attribute_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_product_with_images() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request( - 'POST', - '/api/v1/products/', - [], - ['images' => [ - ['file' => new UploadedFile(sprintf('%s/../Resources/fixtures/ford.jpg', __DIR__), 'ford')], - ['file' => new UploadedFile(sprintf('%s/../Resources/fixtures/mugs.jpg', __DIR__), 'mugs')], - ]], - static::$authorizedHeaderWithContentType, - $data - ); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_images_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_product_with_associations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/associations.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $this->loadFixturesFromFile('resources/products.yml'); - - $data = -<<client->request('POST', '/api/v1/products/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product/create_with_associations_response', Response::HTTP_CREATED); - } - - /** - * @return string - */ - private function getProductUrl(ProductInterface $product) - { - return '/api/v1/products/' . $product->getCode(); - } -} diff --git a/tests/Controller/ProductAssociationTypeApiTest.php b/tests/Controller/ProductAssociationTypeApiTest.php deleted file mode 100644 index b1ebb042de6..00000000000 --- a/tests/Controller/ProductAssociationTypeApiTest.php +++ /dev/null @@ -1,324 +0,0 @@ -client->request('POST', '/api/v1/product-association-types/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_product_association_type_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/product-association-types/', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_association_type/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_product_association_type() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/product-association-types/', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ], $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_association_type/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_getting_product_association_types_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/product-association-types/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_product_association_types() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/product_association_types.yml'); - - $this->client->request('GET', '/api/v1/product-association-types/', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_association_type/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_product_association_type_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/product-association-types/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_product_association_type_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/product-association-types/-1', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_product_association_type() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productAssociationTypes = $this->loadFixturesFromFile('resources/product_association_types.yml'); - $productAssociationType = $productAssociationTypes['productAssociationType1']; - - $this->client->request('GET', $this->getAssociationTypeUrl($productAssociationType), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_association_type/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_updating_product_association_type_for_non_authenticated_user() - { - $this->client->request('PUT', '/api/v1/product-association-types/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_update_product_association_type_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/product-association-types/-1', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_product_association_type_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $productAssociationTypes = $this->loadFixturesFromFile('resources/product_association_types.yml'); - $productAssociationType = $productAssociationTypes['productAssociationType1']; - - $this->client->request('PUT', $this->getAssociationTypeUrl($productAssociationType), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_association_type/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_product_association_type() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $productAssociationTypes = $this->loadFixturesFromFile('resources/product_association_types.yml'); - $productAssociationType = $productAssociationTypes['productAssociationType1']; - - $data = -<<client->request('PUT', $this->getAssociationTypeUrl($productAssociationType), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ], $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_partially_update_product_association_type_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PATCH', '/api/v1/product-association-types/-1', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_partially_update_product_association_type() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $productAssociationTypes = $this->loadFixturesFromFile('resources/product_association_types.yml'); - $productAssociationType = $productAssociationTypes['productAssociationType1']; - - $data = -<<client->request('PATCH', $this->getAssociationTypeUrl($productAssociationType), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ], $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_product_association_type_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/product-association-types/-1', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_product_association_type() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productAssociationTypes = $this->loadFixturesFromFile('resources/product_association_types.yml'); - $productAssociationType = $productAssociationTypes['productAssociationType1']; - - $this->client->request('DELETE', $this->getAssociationTypeUrl($productAssociationType), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getAssociationTypeUrl($productAssociationType), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @return string - */ - private function getAssociationTypeUrl(ProductAssociationTypeInterface $productAssociationType) - { - return 'api/v1/product-association-types/' . $productAssociationType->getCode(); - } -} diff --git a/tests/Controller/ProductAttributeApiTest.php b/tests/Controller/ProductAttributeApiTest.php deleted file mode 100644 index a58237e60b5..00000000000 --- a/tests/Controller/ProductAttributeApiTest.php +++ /dev/null @@ -1,358 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_product_attributes_list_when_access_is_denied() - { - $this->loadFixturesFromFile('resources/product_attributes.yml'); - - $this->client->request('GET', '/api/v1/product-attributes/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_indexing_product_attributes() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/product_attributes.yml'); - - $this->client->request('GET', '/api/v1/product-attributes/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_product_attribute_when_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/product-attributes/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_showing_product_attribute() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productAttributes = $this->loadFixturesFromFile('resources/product_attributes.yml'); - $productAttribute = $productAttributes['productAttribute1']; - - $this->client->request('GET', $this->getProductAttributeUrl($productAttribute), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_delete_product_attribute_if_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/product-attributes/-1', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_product_attribute() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productAttributes = $this->loadFixturesFromFile('resources/product_attributes.yml'); - $productAttribute = $productAttributes['productAttribute1']; - - $this->client->request('DELETE', $this->getProductAttributeUrl($productAttribute), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/product-attributes/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/index_response_after_delete', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_create_product_attribute() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/product-attributes/text', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_product_attribute_without_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/product-attributes/text', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_product_attribute_without_type() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/product-attributes', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCodeOneOf($response, [Response::HTTP_NOT_FOUND, Response::HTTP_METHOD_NOT_ALLOWED]); - } - - /** - * @test - */ - public function it_allows_to_update_product_attribute() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $productAttributes = $this->loadFixturesFromFile('resources/product_attributes.yml'); - $productAttribute = $productAttributes['productAttribute1']; - - $data = -<<client->request('PUT', $this->getProductAttributeUrl($productAttribute), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getProductAttributeUrl($productAttribute), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/show_response_after_update', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_partially_update_product_attribute() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $productAttributes = $this->loadFixturesFromFile('resources/product_attributes.yml'); - $productAttribute = $productAttributes['productAttribute1']; - - $data = -<<client->request('PATCH', $this->getProductAttributeUrl($productAttribute), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getProductAttributeUrl($productAttribute), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/show_response_after_partial_update', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_change_product_attribute_type() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $productAttributes = $this->loadFixturesFromFile('resources/product_attributes.yml'); - $productAttribute = $productAttributes['productAttribute1']; - - $data = -<<client->request('PATCH', $this->getProductAttributeUrl($productAttribute), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getProductAttributeUrl($productAttribute), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_create_select_product_attribute() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/product-attributes/select', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_attribute/create_select_response', Response::HTTP_CREATED); - - $expectedChoiceValues = [ - ['en_US' => 'yellow', 'fr_FR' => 'jaune'], - ['en_US' => 'green'], - ['en_US' => 'black'], - ]; - $this->assertSelectChoicesInResponse($response, $expectedChoiceValues); - } - - /** - * @return string - */ - private function getProductAttributeUrl(ProductAttributeInterface $productAttribute) - { - return '/api/v1/product-attributes/' . $productAttribute->getCode(); - } - - /** - * @param array|string[] $expectedChoiceValues - */ - private function assertSelectChoicesInResponse(Response $response, array $expectedChoiceValues): void - { - $responseContent = json_decode($response->getContent(), true); - Assert::assertArrayHasKey('configuration', $responseContent); - - $configuration = $responseContent['configuration']; - Assert::assertArrayHasKey('choices', $configuration); - - $choices = $configuration['choices']; - Assert::assertCount(count($expectedChoiceValues), $choices); - - foreach ($expectedChoiceValues as $expectedChoiceValue) { - Assert::assertContains($expectedChoiceValue, $choices); - } - - foreach ($choices as $choiceKey => $choiceValue) { - Assert::assertRegExp('/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i', $choiceKey); - } - } - - private function assertResponseCodeOneOf(Response $response, array $statusCodes): void - { - self::assertContains($response->getStatusCode(), $statusCodes, $response->getContent()); - } -} diff --git a/tests/Controller/ProductOptionApiTest.php b/tests/Controller/ProductOptionApiTest.php deleted file mode 100644 index 5a5e4d3ce5b..00000000000 --- a/tests/Controller/ProductOptionApiTest.php +++ /dev/null @@ -1,339 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_product_options_list_when_access_is_denied() - { - $this->loadFixturesFromFile('resources/product_options.yml'); - - $this->client->request('GET', '/api/v1/product-options/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_indexing_product_options() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/product_options.yml'); - - $this->client->request('GET', '/api/v1/product-options/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_option/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_product_option_when_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/product-options/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_showing_product_option() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productOptions = $this->loadFixturesFromFile('resources/product_options.yml'); - $productOption = $productOptions['mug-size']; - - $this->client->request('GET', $this->getProductOptionUrl($productOption), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_option/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_delete_product_option_if_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/product-options/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_product_option() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productOptions = $this->loadFixturesFromFile('resources/product_options.yml'); - $productOption = $productOptions['mug-size']; - - $this->client->request('DELETE', $this->getProductOptionUrl($productOption), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/product-options/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_option/index_response_after_delete', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_create_product_option_with_multiple_translations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/product-options/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_option/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_product_option_without_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/product-options/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_option/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_product_option_with_multiple_translations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $productOptions = $this->loadFixturesFromFile('resources/product_options.yml'); - $productOption = $productOptions['mug-size']; - - $data = -<<client->request('PUT', $this->getProductOptionUrl($productOption), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getProductOptionUrl($productOption), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_option/show_response_after_update', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_partially_update_product_option_with_multiple_translations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $productOptions = $this->loadFixturesFromFile('resources/product_options.yml'); - $productOption = $productOptions['mug-size']; - - $data = -<<client->request('PATCH', $this->getProductOptionUrl($productOption), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getProductOptionUrl($productOption), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'product_option/show_response_after_partial_update', Response::HTTP_OK); - } - - /** - * @return string - */ - private function getProductOptionUrl(ProductOptionInterface $productOption) - { - return '/api/v1/product-options/' . $productOption->getCode(); - } -} diff --git a/tests/Controller/ProductReviewApiTest.php b/tests/Controller/ProductReviewApiTest.php deleted file mode 100644 index 468c7effcea..00000000000 --- a/tests/Controller/ProductReviewApiTest.php +++ /dev/null @@ -1,341 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allows_showing_product_review_list_when_access_is_denied() - { - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - $this->client->request('GET', $this->getReviewListUrl($product)); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allows_showing_product_review_when_it_does_not_exist() - { - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - $this->client->request('GET', $this->getReviewListUrl($product) . '0', [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_showing_product_review() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - /** @var ReviewInterface $productReview */ - $productReview = $productReviewsData['productReview1']; - - $this->client->request('GET', $this->getReviewUrl($product, $productReview), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_review/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_indexing_product_reviews() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - $this->client->request('GET', $this->getReviewListUrl($product), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_review/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_creating_product_review() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - $data = -<<client->request('POST', $this->getReviewListUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_review/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allows_creating_product_review_without_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - $this->client->request('POST', $this->getReviewListUrl($product), [], [], static::$authorizedHeaderWithContentType); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_review/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_does_not_allows_deleting_product_review_if_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - $this->client->request('DELETE', $this->getReviewListUrl($product) . '0', [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_deleting_product_review() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - /** @var ReviewInterface $productReview */ - $productReview = $productReviewsData['productReview1']; - - $this->client->request('DELETE', $this->getReviewUrl($product, $productReview), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - $this->client->request('GET', $this->getReviewUrl($product, $productReview), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_updating_information_about_product_review() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - /** @var ReviewInterface $productReview */ - $productReview = $productReviewsData['productReview1']; - - $data = -<<client->request('PUT', $this->getReviewUrl($product, $productReview), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_updating_partial_information_about_product_review() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - /** @var ReviewInterface $productReview */ - $productReview = $productReviewsData['productReview1']; - - $data = -<<client->request('PATCH', $this->getReviewUrl($product, $productReview), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_accepting_product_review() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - /** @var ReviewInterface $productReview */ - $productReview = $productReviewsData['productReview1']; - - $this->client->request('PATCH', $this->getReviewUrl($product, $productReview) . '/accept', [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_review/accept_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allows_accepting_product_review_if_it_has_not_new_status() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - /** @var ReviewInterface $productReview */ - $productReview = $productReviewsData['productReview3']; - - $this->client->request('POST', $this->getReviewUrl($product, $productReview) . '/accept', [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_review/change_status_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_rejecting_product_review() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - /** @var ReviewInterface $productReview */ - $productReview = $productReviewsData['productReview1']; - - $this->client->request('PATCH', $this->getReviewUrl($product, $productReview) . '/reject', [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_review/reject_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allows_rejecting_product_review_if_it_has_not_new_status() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productReviewsData = $this->loadFixturesFromFile('resources/product_reviews.yml'); - - /** @var ProductInterface $product */ - $product = $productReviewsData['product1']; - - /** @var ReviewInterface $productReview */ - $productReview = $productReviewsData['productReview3']; - - $this->client->request('POST', $this->getReviewUrl($product, $productReview) . '/accept', [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_review/change_status_fail_response', Response::HTTP_BAD_REQUEST); - } - - private function getReviewListUrl(ProductInterface $product): string - { - return sprintf('/api/v1/products/%s/reviews/', $product->getCode()); - } - - private function getReviewUrl(ProductInterface $product, ReviewInterface $productReview): string - { - return sprintf('%s%s', $this->getReviewListUrl($product), $productReview->getId()); - } -} diff --git a/tests/Controller/ProductVariantApiTest.php b/tests/Controller/ProductVariantApiTest.php deleted file mode 100644 index f3965348892..00000000000 --- a/tests/Controller/ProductVariantApiTest.php +++ /dev/null @@ -1,619 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_product_variant_list_when_access_is_denied() - { - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $this->client->request('GET', $this->getVariantListUrl($product)); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_product_variant_when_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $this->client->request('GET', $this->getVariantListUrl($product) . 'code', [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_showing_product_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - /** @var ProductVariantInterface $productVariant */ - $productVariant = $productVariantsData['productVariant2']; - - $this->client->request('GET', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_indexing_product_variants() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $this->client->request('GET', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_paginating_the_index_of_product_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $this->client->request('GET', $this->getVariantListUrl($product), ['page' => 2], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/paginated_index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_sorting_the_index_of_product_variants() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $this->client->request('GET', $this->getVariantListUrl($product), ['sorting' => ['position' => 'desc']], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/sorted_index_response'); - } - - /** - * @test - */ - public function it_allows_create_product_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $data = -<<client->request('POST', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_product_variant_without_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $this->client->request('POST', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithContentType); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_create_product_variant_with_multiple_translations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/locales.yml', - 'resources/product_variants.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $data = -<<client->request('POST', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/create_with_translations_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_create_product_variant_with_channel_pricings() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/channels.yml', - 'resources/product_variants.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $data = -<<client->request('POST', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/create_with_channel_pricings_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_create_tracked_product_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $data = -<<client->request('POST', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/create_tracked_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_create_product_variant_with_tax_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/product_variants.yml', - 'resources/tax_categories.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $data = -<<client->request('POST', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/create_with_tax_category_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_create_product_variant_with_shipping_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/product_variants.yml', - 'resources/shipping_categories.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $data = -<<client->request('POST', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/create_with_shipping_category_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_create_product_variant_with_product_option() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/locales.yml', - 'resources/product_variants.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $data = -<<client->request('POST', $this->getVariantListUrl($product), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/create_with_product_option_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allow_delete_product_variant_if_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $this->client->request('DELETE', $this->getVariantListUrl($product) . 'code', [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_delete_product_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - /** @var ProductVariantInterface $productVariant */ - $productVariant = $productVariantsData['productVariant1']; - - $this->client->request('DELETE', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - $this->client->request('GET', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_updating_information_about_product_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFile('resources/product_variants.yml'); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - /** @var ProductVariantInterface $productVariant */ - $productVariant = $productVariantsData['productVariant1']; - - $version = $productVariantsData['productVariant1']->getVersion(); - - $data = -<<client->request('PUT', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_updating_partial_information_about_product_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/locales.yml', - 'resources/product_variants.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - /** @var ProductVariantInterface $productVariant */ - $productVariant = $productVariantsData['productVariant1']; - - $data = -<<client->request('PATCH', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_updating_information_about_product_variant_options() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/locales.yml', - 'resources/product_variants.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - /** @var ProductVariantInterface $productVariant */ - $productVariant = $productVariantsData['productVariant22']; - - $version = $productVariant->getVersion(); - - $data = -<<client->request('PUT', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_does_not_allow_nulling_information_about_product_variant_options() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/locales.yml', - 'resources/product_variants.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - /** @var ProductVariantInterface $productVariant */ - $productVariant = $productVariantsData['productVariant22']; - - $version = $productVariant->getVersion(); - - $data = -<<client->request('PUT', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_updating_partial_information_about_product_variant_options() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/locales.yml', - 'resources/product_variants.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product1']; - - /** @var ProductVariantInterface $productVariant */ - $productVariant = $productVariantsData['productVariant22']; - - $data = -<<client->request('PATCH', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_not_change_on_hand_after_updating_product_variant() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productVariantsData = $this->loadFixturesFromFiles([ - 'resources/locales.yml', - 'resources/product_variants.yml', - ]); - - /** @var ProductInterface $product */ - $product = $productVariantsData['product2']; - - /** @var ProductVariantInterface $productVariant */ - $productVariant = $productVariantsData['productVariant21']; - - $data = -<<client->request('PATCH', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getVariantUrl($product, $productVariant), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'product_variant/not_changed_on_hand_response', Response::HTTP_OK); - } - - /** - * @return string - */ - private function getVariantListUrl(ProductInterface $product) - { - return sprintf('/api/v1/products/%s/variants/', $product->getCode()); - } - - /** - * @return string - */ - private function getVariantUrl(ProductInterface $product, ProductVariantInterface $productVariant) - { - return sprintf('%s%s', $this->getVariantListUrl($product), $productVariant->getCode()); - } -} diff --git a/tests/Controller/PromotionApiTest.php b/tests/Controller/PromotionApiTest.php deleted file mode 100644 index 629b9c530ad..00000000000 --- a/tests/Controller/PromotionApiTest.php +++ /dev/null @@ -1,497 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_promotions_list_when_access_is_denied() - { - $this->loadFixturesFromFile('resources/promotions.yml'); - - $this->client->request('GET', '/api/v1/promotions/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_indexing_promotions() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/promotions.yml'); - - $this->client->request('GET', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_sorting_the_index_of_promotions_by_code() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/promotions.yml'); - $this->loadFixturesFromFile('resources/many_promotions.yml'); - - $this->client->request('GET', '/api/v1/promotions/', ['sorting' => ['code' => 'asc']], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/sorted_by_code_index_response'); - } - - /** - * @test - */ - public function it_allows_sorting_the_index_of_promotions_by_name() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/promotions.yml'); - $this->loadFixturesFromFile('resources/many_promotions.yml'); - - $this->client->request('GET', '/api/v1/promotions/', ['sorting' => ['name' => 'desc']], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/sorted_by_name_index_response'); - } - - /** - * @test - */ - public function it_allows_sorting_the_index_of_promotions_by_priority() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/promotions.yml'); - $this->loadFixturesFromFile('resources/many_promotions.yml'); - - $this->client->request('GET', '/api/v1/promotions/', ['sorting' => ['priority' => 'asc']], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/sorted_by_priority_index_response'); - } - - /** - * @test - */ - public function it_allows_to_get_promotions_list_filtered_by_name_and_code() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/promotions.yml'); - $this->loadFixturesFromFile('resources/many_promotions.yml'); - - $this->client->request('GET', '/api/v1/promotions/', ['criteria' => ['search' => 'promo']], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/filtered_by_code_and_name_index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_list_of_coupon_based_promotions() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/promotions.yml'); - $this->loadFixturesFromFile('resources/many_promotions.yml'); - - $this->client->request('GET', '/api/v1/promotions/', ['criteria' => ['couponBased' => 'true']], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/only_coupon_based_index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_promotion_when_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/promotions/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_showing_promotion() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('GET', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_delete_promotion_if_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/promotions/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_promotion() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion1']; - - $this->client->request('DELETE', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_promotion_without_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_promotion() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_promotion_with_channels() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/channels.yml'); - - $data = -<<client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/create_response_with_channels', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_promotion_with_time_of_duration() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/create_response_with_time_of_duration', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_promotion_with_rules() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/channels.yml'); - - $data = -<<client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/create_response_with_rules', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_promotion_with_actions() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFiles([ - 'resources/channels.yml', - 'resources/products.yml', - 'resources/product_taxons.yml', - ]); - - $data = -<<client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/create_response_with_actions', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_coupon_based_promotion() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/create_coupon_based_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_exclusive_promotion() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/promotions/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/create_exclusive_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_updating_promotion() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion1']; - - $data = -<<client->request('PUT', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/show_response_after_update', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_updating_partial_information_about_promotion() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion1']; - - $data = -<<client->request('PATCH', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getPromotionUrl($promotion), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion/show_response_after_partial_update', Response::HTTP_OK); - } - - /** - * @return string - */ - private function getPromotionUrl(PromotionInterface $promotion) - { - return '/api/v1/promotions/' . $promotion->getCode(); - } -} diff --git a/tests/Controller/PromotionCouponApiTest.php b/tests/Controller/PromotionCouponApiTest.php deleted file mode 100644 index 15b303724b7..00000000000 --- a/tests/Controller/PromotionCouponApiTest.php +++ /dev/null @@ -1,388 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_promotion_coupons_list_when_access_is_denied() - { - $promotions = $this->loadFixturesFromFiles([ - 'resources/promotions.yml', - 'resources/promotion_coupons.yml', - ]); - $promotion = $promotions['promotion2']; - - $this->client->request('GET', $this->getPromotionCouponsUrl($promotion)); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_indexing_promotion_coupons() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFiles([ - 'resources/promotions.yml', - 'resources/promotion_coupons.yml', - ]); - - $promotion = $promotions['promotion2']; - - $this->client->request('GET', $this->getPromotionCouponsUrl($promotion), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion_coupon/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_coupon_for_not_authenticated_users() - { - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('POST', $this->getPromotionCouponsUrl($promotion)); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_coupon_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('POST', $this->getPromotionCouponsUrl($promotion), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion_coupon/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_coupon_with_given_code() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $data = -<<client->request('POST', $this->getPromotionCouponsUrl($promotion), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion_coupon/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_to_create_coupon_with_given_code_expiration_date_and_usage_limits() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $data = -<<client->request('POST', $this->getPromotionCouponsUrl($promotion), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion_coupon/create_advanced_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_getting_coupon_for_non_authenticated_user() - { - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('GET', sprintf('/api/v1/promotions/%s/coupons/-1', $promotion->getCode())); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_coupon_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('GET', sprintf('/api/v1/promotions/%s/coupons/1', $promotion->getCode()), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_a_coupon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFiles([ - 'resources/promotions.yml', - 'resources/promotion_coupons.yml', - ]); - - $promotion = $promotions['promotion2']; - $coupon = $promotions['promotionCoupon1']; - - $this->client->request('GET', $this->getPromotionCouponUrl($promotion, $coupon), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'promotion_coupon/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_coupon_full_update_for_not_authenticated_users() - { - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('PUT', sprintf('/api/v1/promotions/%s/coupons/1', $promotion->getCode())); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_full_update_of_a_coupon_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('PUT', sprintf('/api/v1/promotions/%s/coupons/1', $promotion->getCode()), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_fully_update_coupon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFiles([ - 'resources/promotions.yml', - 'resources/promotion_coupons.yml', - ]); - - $promotion = $promotions['promotion2']; - $promotionCoupon = $promotions['promotionCoupon2']; - - $data = -<<client->request('PUT', $this->getPromotionCouponUrl($promotion, $promotionCoupon), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getPromotionCouponUrl($promotion, $promotionCoupon), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'promotion_coupon/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_coupon_partial_update_for_not_authenticated_users() - { - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('PATCH', sprintf('/api/v1/promotions/%s/coupons/1', $promotion->getCode())); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_partial_update_of_a_coupon_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('PATCH', sprintf('/api/v1/promotions/%s/coupons/1', $promotion->getCode()), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_partially_update_coupon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFiles([ - 'resources/promotions.yml', - 'resources/promotion_coupons.yml', - ]); - - $promotion = $promotions['promotion2']; - $promotionCoupon = $promotions['promotionCoupon2']; - - $data = -<<client->request('PATCH', $this->getPromotionCouponUrl($promotion, $promotionCoupon), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getPromotionCouponUrl($promotion, $promotionCoupon), [], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'promotion_coupon/partial_update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_coupon_delete_for_not_authenticated_users() - { - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('DELETE', sprintf('/api/v1/promotions/%s/coupons/1', $promotion->getCode())); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_delete_of_a_coupon_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFile('resources/promotions.yml'); - $promotion = $promotions['promotion2']; - - $this->client->request('DELETE', sprintf('/api/v1/promotions/%s/coupons/123123', $promotion->getCode()), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_a_coupon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $promotions = $this->loadFixturesFromFiles([ - 'resources/promotions.yml', - 'resources/promotion_coupons.yml', - ]); - - $promotion = $promotions['promotion2']; - $promotionCoupon = $promotions['promotionCoupon2']; - - $this->client->request('DELETE', $this->getPromotionCouponUrl($promotion, $promotionCoupon), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getPromotionCouponUrl($promotion, $promotionCoupon), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @return string - */ - private function getPromotionCouponUrl(PromotionInterface $promotion, PromotionCouponInterface $coupon = null) - { - return sprintf('/api/v1/promotions/%s/coupons/%s', $promotion->getCode(), $coupon->getCode()); - } - - /** - * @return string - */ - private function getPromotionCouponsUrl(PromotionInterface $promotion) - { - return sprintf('/api/v1/promotions/%s/coupons/', $promotion->getCode()); - } -} diff --git a/tests/Controller/ProvinceApiTest.php b/tests/Controller/ProvinceApiTest.php deleted file mode 100644 index 663670a92c0..00000000000 --- a/tests/Controller/ProvinceApiTest.php +++ /dev/null @@ -1,70 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_getting_province_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/countries/FR/provinces/centre'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_province() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $countryData = $this->loadFixturesFromFile('resources/countries.yml'); - - $this->client->request('GET', '/api/v1/countries/' . $countryData['country_BE']->getCode() . '/provinces/' . $countryData['province_BE_limburg']->getCode(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'province/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_delete_province() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $countryData = $this->loadFixturesFromFile('resources/countries.yml'); - - $this->client->request('DELETE', '/api/v1/countries/' . $countryData['country_BE']->getCode() . '/provinces/' . $countryData['province_BE_limburg']->getCode(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/countries/' . $countryData['country_BE']->getCode() . '/provinces/' . $countryData['province_BE_limburg']->getCode(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } -} diff --git a/tests/Controller/ShipmentApiTest.php b/tests/Controller/ShipmentApiTest.php deleted file mode 100644 index 0b82432ca4a..00000000000 --- a/tests/Controller/ShipmentApiTest.php +++ /dev/null @@ -1,107 +0,0 @@ -client->request('GET', $this->getShipmentUrl(-1)); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_shipment_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', $this->getShipmentUrl(-1), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_shipment() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $orderId = $this->prepareOrder(); - - $this->client->request('GET', $this->getOrderUrl($orderId), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $rawResponse = json_decode($response->getContent(), true); - - $this->client->request('GET', $this->getShipmentUrl($rawResponse['shipments'][0]['id']), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipment/shipment_show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_a_collection_of_shipments_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/shipments/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_a_collection_of_shipments() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/checkout.yml'); - - $this->prepareOrder(); - - $this->client->request('GET', '/api/v1/shipments/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipment/shipment_index_response', Response::HTTP_OK); - } - - /** - * @return string - */ - private function getOrderUrl($orderId) - { - return '/api/v1/orders/' . $orderId; - } - - /** - * @return string - */ - private function getShipmentUrl($shipmentId) - { - return '/api/v1/shipments/' . $shipmentId; - } -} diff --git a/tests/Controller/ShippingCategoryApiTest.php b/tests/Controller/ShippingCategoryApiTest.php deleted file mode 100644 index 2c0d5fb2ad5..00000000000 --- a/tests/Controller/ShippingCategoryApiTest.php +++ /dev/null @@ -1,302 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'Accept' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_creating_shipping_category_for_non_authenticated_user() - { - $this->client->request('POST', '/api/v1/shipping-categories/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_shipping_category_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/shipping-categories/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipping_category/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_shipping_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/shipping-categories/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipping_category/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_getting_shipping_categories_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/shipping-categories/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_shipping_categories_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/shipping_categories.yml'); - - $this->client->request('GET', '/api/v1/shipping-categories/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipping_category/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_shipping_category_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/shipping-categories/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_shipping_category_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/shipping-categories/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_shipping_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $shippingCategories = $this->loadFixturesFromFile('resources/shipping_categories.yml'); - - /** @var ShippingCategoryInterface $shippingCategory */ - $shippingCategory = $shippingCategories['shipping_category_2']; - - $this->client->request('GET', $this->getShippingCategoryUrl($shippingCategory), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipping_category/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_updating_shipping_category_for_non_authenticated_user() - { - $this->client->request('PUT', '/api/v1/shipping-categories/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_updating_shipping_category_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/shipping-categories/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_shipping_category_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $shippingCategories = $this->loadFixturesFromFile('resources/shipping_categories.yml'); - - /** @var ShippingCategoryInterface $shippingCategory */ - $shippingCategory = $shippingCategories['shipping_category_1']; - - $this->client->request('PUT', $this->getShippingCategoryUrl($shippingCategory), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipping_category/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_shipping_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $shippingCategories = $this->loadFixturesFromFile('resources/shipping_categories.yml'); - - /** @var ShippingCategoryInterface $shippingCategory */ - $shippingCategory = $shippingCategories['shipping_category_1']; - - $data = -<<client->request('PUT', $this->getShippingCategoryUrl($shippingCategory), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getShippingCategoryUrl($shippingCategory), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipping_category/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_partially_updating_shipping_category_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PATCH', '/api/v1/shipping-categories/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_partially_update_shipping_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $shippingCategories = $this->loadFixturesFromFile('resources/shipping_categories.yml'); - - /** @var ShippingCategoryInterface $shippingCategory */ - $shippingCategory = $shippingCategories['shipping_category_1']; - - $data = -<<client->request('PATCH', $this->getShippingCategoryUrl($shippingCategory), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getShippingCategoryUrl($shippingCategory), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipping_category/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_shipping_category_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/shipping-categories/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_shipping_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $shippingCategories = $this->loadFixturesFromFile('resources/shipping_categories.yml'); - - /** @var ShippingCategoryInterface $shippingCategory */ - $shippingCategory = $shippingCategories['shipping_category_2']; - - $this->client->request('DELETE', $this->getShippingCategoryUrl($shippingCategory), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getShippingCategoryUrl($shippingCategory), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @return string - */ - private function getShippingCategoryUrl(ShippingCategoryInterface $shippingCategory) - { - return '/api/v1/shipping-categories/' . $shippingCategory->getCode(); - } -} diff --git a/tests/Controller/ShippingMethodApiTest.php b/tests/Controller/ShippingMethodApiTest.php deleted file mode 100644 index c01c5abf2b2..00000000000 --- a/tests/Controller/ShippingMethodApiTest.php +++ /dev/null @@ -1,105 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithDenied = [ - 'HTTP_Authorization' => 'Bearer wrong_token', - 'HTTP_ACCEPT' => 'application/json', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_to_show_shipping_method_for_not_authenticated_users(): void - { - /** @var ShippingMethodInterface $shippingMethod */ - $shippingMethod = $this->loadFixturesFromFiles([ - 'resources/zones.yml', - 'resources/shipping_methods.yml', - ])['ups']; - - $this->client->request( - Request::METHOD_GET, - $this->getShippingMethodUrl($shippingMethod), - [], - [], - static::$authorizedHeaderWithDenied - ); - - $this->assertResponseCode($this->client->getResponse(), Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_shipping_method_when_it_does_not_exist(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request( - Request::METHOD_GET, - '/api/v1/shipping-methods/-1', - [], - [], - static::$authorizedHeaderWithAccept - ); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_showing_shipping_method(): void - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $shippingMethods = $this->loadFixturesFromFiles([ - 'resources/zones.yml', - 'resources/shipping_methods.yml', - ]); - $shippingMethod = $shippingMethods['ups']; - - $this->client->request( - Request::METHOD_GET, - $this->getShippingMethodUrl($shippingMethod), - [], - [], - static::$authorizedHeaderWithAccept - ); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'shipping_method/show_response', Response::HTTP_OK); - } - - private function getShippingMethodUrl(ShippingMethodInterface $shippingMethod): string - { - return '/api/v1/shipping-methods/' . $shippingMethod->getCode(); - } -} diff --git a/tests/Controller/TaxCategoryApiTest.php b/tests/Controller/TaxCategoryApiTest.php deleted file mode 100644 index f161b1332a1..00000000000 --- a/tests/Controller/TaxCategoryApiTest.php +++ /dev/null @@ -1,355 +0,0 @@ -client->request('POST', '/api/v1/tax-categories/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_tax_category_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/tax-categories/', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_category/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_tax_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/tax-categories/', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ], $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_category/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_getting_tax_categories_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/tax-categories/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_tax_categories() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/tax_categories.yml'); - - $this->client->request('GET', '/api/v1/tax-categories/', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_category/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_sorted_tax_categories() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/tax_categories.yml'); - - $this->client->request('GET', '/api/v1/tax-categories/', ['sorting' => ['nameAndDescription' => 'asc']], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_category/sorted_index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_tax_categories_list_filtered_by_name() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/tax_categories_for_filtering.yml'); - - $this->client->request('GET', '/api/v1/tax-categories/', ['criteria' => ['search' => 'clothing']], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_category/filtered_by_name_index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_to_get_tax_categories_list_filtered_by_code() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/tax_categories_for_filtering.yml'); - - $this->client->request('GET', '/api/v1/tax-categories/', ['criteria' => ['search' => 'TC1']], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_category/filtered_by_code_index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_getting_tax_category_for_non_authenticated_user() - { - $this->client->request('GET', '/api/v1/tax-categories/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_tax_category_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/tax-categories/-1', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_get_tax_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxCategories = $this->loadFixturesFromFile('resources/tax_categories.yml'); - $taxCategory = $taxCategories['tax_category_1']; - - $this->client->request('GET', $this->getTaxCategoryUrl($taxCategory), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_category/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_updating_tax_category_for_non_authenticated_user() - { - $this->client->request('PUT', '/api/v1/tax-categories/1'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_update_tax_category_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/tax-categories/-1', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_tax_category_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxCategories = $this->loadFixturesFromFile('resources/tax_categories.yml'); - $taxCategory = $taxCategories['tax_category_1']; - - $this->client->request('PUT', $this->getTaxCategoryUrl($taxCategory), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_category/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_tax_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxCategories = $this->loadFixturesFromFile('resources/tax_categories.yml'); - $taxCategory = $taxCategories['tax_category_1']; - - $data = -<<client->request('PUT', $this->getTaxCategoryUrl($taxCategory), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ], $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_partially_update_tax_category_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PATCH', '/api/v1/tax-categories/-1', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_partially_update_tax_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxCategories = $this->loadFixturesFromFile('resources/tax_categories.yml'); - $taxCategory = $taxCategories['tax_category_1']; - - $data = -<<client->request('PATCH', $this->getTaxCategoryUrl($taxCategory), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ], $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_trying_to_delete_tax_category_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/tax-categories/-1', [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_tax_category() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxCategories = $this->loadFixturesFromFile('resources/tax_categories.yml'); - $taxCategory = $taxCategories['tax_category_1']; - - $this->client->request('DELETE', $this->getTaxCategoryUrl($taxCategory), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getTaxCategoryUrl($taxCategory), [], [], [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @return string - */ - private function getTaxCategoryUrl(TaxCategoryInterface $taxCategory) - { - return 'api/v1/tax-categories/' . $taxCategory->getCode(); - } -} diff --git a/tests/Controller/TaxRateApiTest.php b/tests/Controller/TaxRateApiTest.php deleted file mode 100644 index 815f2ae5cb8..00000000000 --- a/tests/Controller/TaxRateApiTest.php +++ /dev/null @@ -1,102 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_tax_rates_list_when_access_is_denied() - { - $this->loadFixturesFromFiles([ - 'resources/tax_categories.yml', - 'resources/zones.yml', - 'resources/tax_rates.yml', - ]); - - $this->client->request('GET', '/api/v1/tax-rates/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_indexing_tax_rates() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFiles([ - 'resources/tax_categories.yml', - 'resources/zones.yml', - 'resources/tax_rates.yml', - ]); - - $this->client->request('GET', '/api/v1/tax-rates/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_rate/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_tax_rate_when_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/tax-rates/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_showing_tax_rate() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxRates = $this->loadFixturesFromFiles([ - 'resources/zones.yml', - 'resources/tax_categories.yml', - 'resources/tax_rates.yml', - ]); - $taxRate = $taxRates['sales_tax']; - - $this->client->request('GET', $this->getTaxRateUrl($taxRate), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'tax_rate/show_response', Response::HTTP_OK); - } - - /** - * @return string - */ - private function getTaxRateUrl(TaxRateInterface $taxRate) - { - return '/api/v1/tax-rates/' . $taxRate->getCode(); - } -} diff --git a/tests/Controller/TaxonApiTest.php b/tests/Controller/TaxonApiTest.php deleted file mode 100644 index 347e5fabd23..00000000000 --- a/tests/Controller/TaxonApiTest.php +++ /dev/null @@ -1,513 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_does_not_allow_to_show_taxon_list_when_access_is_denied() - { - $this->loadFixturesFromFile('resources/taxons.yml'); - $this->client->request('GET', '/api/v1/taxons/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_show_taxon_when_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/taxons/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_indexing_taxons() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/taxons.yml'); - - $this->client->request('GET', '/api/v1/taxons/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_showing_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxons = $this->loadFixturesFromFile('resources/taxons.yml'); - $taxon = $taxons['women']; - - $this->client->request('GET', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_allows_showing_root_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxons = $this->loadFixturesFromFile('resources/taxons.yml'); - $taxon = $taxons['category']; - - $this->client->request('GET', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/show_root_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_does_not_allow_to_delete_taxon_if_it_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/taxons/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_deleting_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxons = $this->loadFixturesFromFile('resources/taxons.yml'); - $taxon = $taxons['men']; - - $this->client->request('DELETE', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_deleting_root_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $taxons = $this->loadFixturesFromFile('resources/taxons.yml'); - $taxon = $taxons['category']; - - $this->client->request('DELETE', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_creating_root_taxon_with_multiple_translations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - - $data = -<<client->request('POST', '/api/v1/taxons/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/create_root_with_multiple_translations_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_root_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/taxons/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/create_root_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_taxon_with_multiple_translations() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $this->loadFixturesFromFile('resources/taxons.yml'); - - $data = -<<client->request('POST', '/api/v1/taxons/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/create_with_multiple_translations_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_creating_taxon_with_parent() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/taxons.yml'); - - $data = -<<client->request('POST', '/api/v1/taxons/', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/create_with_parent_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_taxon_without_required_fields() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/taxons/', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_creating_taxon_with_images() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $data = -<<client->request('POST', '/api/v1/taxons/', [], [ - 'images' => [ - ['file' => new UploadedFile(sprintf('%s/../Resources/fixtures/ford.jpg', __DIR__), 'ford')], - ['file' => new UploadedFile(sprintf('%s/../Resources/fixtures/mugs.jpg', __DIR__), 'mugs')], - ], - ], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/create_with_images_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_allows_updating_taxon_with_parent() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $taxons = $this->loadFixturesFromFile('resources/taxons.yml'); - $taxon = $taxons['women']; - - $data = -<<client->request('PUT', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_updating_root_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $taxons = $this->loadFixturesFromFile('resources/taxons.yml'); - $taxon = $taxons['category']; - - $data = -<<client->request('PUT', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_updating_partial_information_about_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $taxons = $this->loadFixturesFromFile('resources/taxons.yml'); - $taxon = $taxons['women']; - - $data = -<<client->request('PATCH', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_updating_partial_information_about_root_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/locales.yml'); - $taxons = $this->loadFixturesFromFile('resources/taxons.yml'); - $taxon = $taxons['category']; - - $data = -<<client->request('PATCH', $this->getTaxonUrl($taxon), [], [], static::$authorizedHeaderWithContentType, $data); - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_allows_paginating_the_index_of_taxons() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/taxons.yml'); - $this->loadFixturesFromFile('resources/many_taxons.yml'); - - $this->client->request('GET', '/api/v1/taxons/', ['page' => 2], [], static::$authorizedHeaderWithAccept); - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/paginated_index_response'); - } - - /** - * @test - */ - public function it_allows_to_update_position_of_product_in_a_taxon() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productTaxons = $this->loadFixturesFromFiles([ - 'resources/products.yml', - 'resources/product_taxons.yml', - ]); - - /** @var TaxonInterface $taxon */ - $taxon = $productTaxons['mugs']; - - $data = -<<client->request('PUT', $this->getTaxonProductsPositionsChangeUrl($taxon), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_position_of_product_in_a_taxon_with_incorrect_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $productTaxons = $this->loadFixturesFromFiles([ - 'resources/products.yml', - 'resources/product_taxons.yml', - ]); - - /** @var TaxonInterface $taxon */ - $taxon = $productTaxons['mugs']; - - $data = -<<client->request('PUT', $this->getTaxonProductsPositionsChangeUrl($taxon), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'taxon/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @return string - */ - private function getTaxonUrl(TaxonInterface $taxon) - { - return '/api/v1/taxons/' . $taxon->getCode(); - } - - /** - * @return string - */ - private function getTaxonProductsPositionsChangeUrl(TaxonInterface $taxon) - { - return sprintf('/api/v1/taxons/%s/products', $taxon->getCode()); - } -} diff --git a/tests/Controller/ZoneApiTest.php b/tests/Controller/ZoneApiTest.php deleted file mode 100644 index 2eedaa754e1..00000000000 --- a/tests/Controller/ZoneApiTest.php +++ /dev/null @@ -1,316 +0,0 @@ - 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'CONTENT_TYPE' => 'application/json', - ]; - - /** @var array */ - private static $authorizedHeaderWithAccept = [ - 'HTTP_Authorization' => 'Bearer SampleTokenNjZkNjY2MDEwMTAzMDkxMGE0OTlhYzU3NzYyMTE0ZGQ3ODcyMDAwM2EwMDZjNDI5NDlhMDdlMQ', - 'ACCEPT' => 'application/json', - ]; - - /** - * @test - */ - public function it_denies_zone_creation_for_non_authenticated_user() - { - $this->client->request('POST', '/api/v1/zones/country'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_does_not_allow_to_create_zone_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('POST', '/api/v1/zones/country', [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'zone/create_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_create_zone_with_members() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - - $data = -<<client->request('POST', '/api/v1/zones/country', [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'zone/create_response', Response::HTTP_CREATED); - } - - /** - * @test - */ - public function it_denies_access_to_zones_list_for_not_authenticated_users() - { - $this->client->request('GET', '/api/v1/zones/'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_allows_to_get_zones_list() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/zones.yml'); - - $this->client->request('GET', '/api/v1/zones/', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'zone/index_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_access_to_zone_details_for_not_authenticated_users() - { - $this->client->request('GET', '/api/v1/zones/azone'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_details_of_a_zone_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('GET', '/api/v1/zones/azone', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_shows_zone_details() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $zones = $this->loadFixturesFromFile('resources/zones.yml'); - - $this->client->request('GET', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'zone/show_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_zone_full_update_for_not_authenticated_users() - { - $this->client->request('PUT', '/api/v1/zones/azone'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_full_update_of_a_zone_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PUT', '/api/v1/zones/-1', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_does_not_allow_to_update_zone_fully_without_specifying_required_data() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $zones = $this->loadFixturesFromFile('resources/zones.yml'); - - $this->client->request('PUT', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'zone/update_validation_fail_response', Response::HTTP_BAD_REQUEST); - } - - /** - * @test - */ - public function it_allows_to_update_zone_fully() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $zones = $this->loadFixturesFromFile('resources/zones.yml'); - - $data = -<<client->request('PUT', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'zone/update_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_zone_partial_update_for_not_authenticated_users() - { - $this->client->request('PATCH', '/api/v1/zones/azone'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_partial_update_of_a_zone_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('PATCH', '/api/v1/zones/azone', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_update_zone_partially() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $this->loadFixturesFromFile('resources/countries.yml'); - $zones = $this->loadFixturesFromFile('resources/zones.yml'); - - $data = -<<client->request('PATCH', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType, $data); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'zone/update_partially_response', Response::HTTP_OK); - } - - /** - * @test - */ - public function it_denies_zone_delete_for_not_authenticated_users() - { - $this->client->request('DELETE', '/api/v1/zones/azone'); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'authentication/access_denied_response', Response::HTTP_UNAUTHORIZED); - } - - /** - * @test - */ - public function it_returns_not_found_response_when_requesting_delete_of_a_zone_which_does_not_exist() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - - $this->client->request('DELETE', '/api/v1/zones/azone', [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponse($response, 'error/not_found_response', Response::HTTP_NOT_FOUND); - } - - /** - * @test - */ - public function it_allows_to_delete_zone() - { - $this->loadFixturesFromFile('authentication/api_administrator.yml'); - $zones = $this->loadFixturesFromFile('resources/zones.yml'); - - $this->client->request('DELETE', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithContentType); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NO_CONTENT); - - $this->client->request('GET', '/api/v1/zones/' . $zones['zone_eu']->getCode(), [], [], static::$authorizedHeaderWithAccept); - - $response = $this->client->getResponse(); - $this->assertResponseCode($response, Response::HTTP_NOT_FOUND); - } -} diff --git a/tests/Responses/admin_user/create_response.json b/tests/Responses/admin_user/create_response.json deleted file mode 100644 index 6a4e0b6f4f6..00000000000 --- a/tests/Responses/admin_user/create_response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": @integer@, - "username": "Balrog", - "usernameCanonical": "balrog", - "roles": [ - "ROLE_ADMINISTRATION_ACCESS" - ], - "email": "teamEvil@middleearth.com", - "emailCanonical": "teamevil@middleearth.com", - "enabled": false -} diff --git a/tests/Responses/admin_user/create_validation_fail_response.json b/tests/Responses/admin_user/create_validation_fail_response.json deleted file mode 100644 index 5b7f62614fa..00000000000 --- a/tests/Responses/admin_user/create_validation_fail_response.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "username": { - "errors": [ - "Please enter your name." - ] - }, - "email": { - "errors": [ - "Please enter your email." - ] - }, - "plainPassword": { - "errors": [ - "Please enter your password." - ] - }, - "enabled": {}, - "firstName": {}, - "lastName": {}, - "localeCode": { - "errors": [ - "Please choose a locale." - ] - }, - "avatar": { - "children": { - "file": {} - } - } - } - } -} diff --git a/tests/Responses/admin_user/create_with_additional_fields_response.json b/tests/Responses/admin_user/create_with_additional_fields_response.json deleted file mode 100644 index 101df3359de..00000000000 --- a/tests/Responses/admin_user/create_with_additional_fields_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "username": "Nenene", - "usernameCanonical": "nenene", - "roles": [ - "ROLE_ADMINISTRATION_ACCESS" - ], - "email": "orange@fruits.com", - "emailCanonical": "orange@fruits.com", - "enabled": true, - "firstName": "Orange", - "lastName": "Annoying" -} diff --git a/tests/Responses/admin_user/deletion_fail_response.json b/tests/Responses/admin_user/deletion_fail_response.json deleted file mode 100644 index 486da742eff..00000000000 --- a/tests/Responses/admin_user/deletion_fail_response.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code": 422, - "message": "Cannot remove currently logged in user." -} diff --git a/tests/Responses/admin_user/index_response.json b/tests/Responses/admin_user/index_response.json deleted file mode 100644 index 350b0b1b0b9..00000000000 --- a/tests/Responses/admin_user/index_response.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 4, - "_links": { - "self": { - "href": "\/api\/v1\/users\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/users\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/users\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "username": "sylius", - "email": "api@sylius.com", - "enabled": true - }, - { - "id": @integer@, - "username": "ExemplaryUser", - "email": "user@example.com", - "enabled": true - }, - { - "id": @integer@, - "username": "@string@", - "email": "@string@", - "enabled": true - }, - { - "id": @integer@, - "username": "@string@", - "email": "@string@", - "enabled": true - } - ] - } -} diff --git a/tests/Responses/admin_user/partial_update_response.json b/tests/Responses/admin_user/partial_update_response.json deleted file mode 100644 index a29de5fe63a..00000000000 --- a/tests/Responses/admin_user/partial_update_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "username": "ExemplaryUser", - "usernameCanonical": "exemplaryuser", - "roles": [ - "ROLE_ADMINISTRATION_ACCESS" - ], - "email": "user@example.com", - "emailCanonical": "user@example.com", - "enabled": true, - "firstName": "John", - "lastName": "Doe" -} diff --git a/tests/Responses/admin_user/show_response.json b/tests/Responses/admin_user/show_response.json deleted file mode 100644 index d533e10cdd8..00000000000 --- a/tests/Responses/admin_user/show_response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": @integer@, - "username": "ExemplaryUser", - "usernameCanonical": "exemplaryuser", - "roles": [ - "ROLE_ADMINISTRATION_ACCESS" - ], - "email": "user@example.com", - "emailCanonical": "user@example.com", - "enabled": true -} diff --git a/tests/Responses/admin_user/update_response.json b/tests/Responses/admin_user/update_response.json deleted file mode 100644 index 101df3359de..00000000000 --- a/tests/Responses/admin_user/update_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "username": "Nenene", - "usernameCanonical": "nenene", - "roles": [ - "ROLE_ADMINISTRATION_ACCESS" - ], - "email": "orange@fruits.com", - "emailCanonical": "orange@fruits.com", - "enabled": true, - "firstName": "Orange", - "lastName": "Annoying" -} diff --git a/tests/Responses/admin_user/update_validation_fail_response.json b/tests/Responses/admin_user/update_validation_fail_response.json deleted file mode 100644 index a6b277b0da3..00000000000 --- a/tests/Responses/admin_user/update_validation_fail_response.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "username": { - "errors": [ - "Please enter your name." - ] - }, - "email": { - "errors": [ - "Please enter your email." - ] - }, - "plainPassword": {}, - "enabled": {}, - "firstName": {}, - "lastName": {}, - "localeCode": { - "errors": [ - "Please choose a locale." - ] - }, - "avatar": { - "children": { - "file": {} - } - } - } - } -} diff --git a/tests/Responses/authentication/access_denied_response.json b/tests/Responses/authentication/access_denied_response.json deleted file mode 100644 index 7fe7d1153e2..00000000000 --- a/tests/Responses/authentication/access_denied_response.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "error": "access_denied", - "error_description": "OAuth2 authentication required" -} diff --git a/tests/Responses/authentication/new_access_token.json b/tests/Responses/authentication/new_access_token.json deleted file mode 100644 index 0ad922aac1c..00000000000 --- a/tests/Responses/authentication/new_access_token.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "access_token": @string@, - "expires_in": 3600, - "token_type": "bearer", - "scope": null, - "refresh_token": @string@ -} diff --git a/tests/Responses/cart/add_to_cart_hard_available_item_response.json b/tests/Responses/cart/add_to_cart_hard_available_item_response.json deleted file mode 100644 index 306852942b6..00000000000 --- a/tests/Responses/cart/add_to_cart_hard_available_item_response.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "id": @integer@, - "quantity": 1, - "unitPrice": 20, - "total": 20, - "units": [ - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - } - ], - "unitsTotal": 20, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "HARD_AVAILABLE_MUG", - "optionValues": [ - { - "code": "MUG_SIZE_L", - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "value": "Size L" - } - } - } - ], - "position": 1, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Breaking bad mug" - } - }, - "version": 1, - "tracked": true, - "channelPricings": { - "WEB": { - "channelCode": "WEB", - "price": 20 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/HARD_AVAILABLE_MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/HARD_AVAILABLE_MUG" - } - } -} diff --git a/tests/Responses/cart/add_to_cart_hard_available_item_validation_error_response.json b/tests/Responses/cart/add_to_cart_hard_available_item_validation_error_response.json deleted file mode 100644 index 43283952394..00000000000 --- a/tests/Responses/cart/add_to_cart_hard_available_item_validation_error_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "code":400, - "message":"Validation Failed", - "errors":{ - "errors":[ - "Mug does not have sufficient stock." - ], - "children":{ - "quantity":{ - - }, - "variant":{ - - } - } - } -} diff --git a/tests/Responses/cart/add_to_cart_quantity_validation_fail_response.json b/tests/Responses/cart/add_to_cart_quantity_validation_fail_response.json deleted file mode 100644 index 85768cdcd45..00000000000 --- a/tests/Responses/cart/add_to_cart_quantity_validation_fail_response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "quantity": { - "errors": [ - "Quantity of an order item cannot be lower than 1." - ] - }, - "variant": { } - } - } -} diff --git a/tests/Responses/cart/add_to_cart_response.json b/tests/Responses/cart/add_to_cart_response.json deleted file mode 100644 index a2aaf7bc1a7..00000000000 --- a/tests/Responses/cart/add_to_cart_response.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "id": @integer@, - "quantity": 1, - "unitPrice": 20, - "total": 20, - "units": [ - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - } - ], - "unitsTotal": 20, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [ - { - "code": "MUG_SIZE_S", - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "value": "Size S" - } - } - } - ], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "tracked": false, - "channelPricings": { - "WEB": { - "channelCode": "WEB", - "price": 20 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } -} diff --git a/tests/Responses/cart/add_to_cart_validation_fail_response.json b/tests/Responses/cart/add_to_cart_validation_fail_response.json deleted file mode 100644 index 4162abb02fe..00000000000 --- a/tests/Responses/cart/add_to_cart_validation_fail_response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "quantity": { - "errors": [ - "Quantity of an order item cannot be lower than 1." - ] - }, - "variant": { - "errors": [ - "This value should not be blank." - ] - } - } - } -} diff --git a/tests/Responses/cart/add_to_cart_with_bigger_quantity_response.json b/tests/Responses/cart/add_to_cart_with_bigger_quantity_response.json deleted file mode 100644 index ca7f8a0ecbe..00000000000 --- a/tests/Responses/cart/add_to_cart_with_bigger_quantity_response.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "id": @integer@, - "quantity": 3, - "unitPrice": 20, - "total": 60, - "units": [ - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - }, - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - }, - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - } - ], - "unitsTotal": 60, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [ - { - "code": "MUG_SIZE_S", - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "value": "Size S" - } - } - } - ], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "tracked": false, - "channelPricings": { - "WEB": { - "channelCode": "WEB", - "price": 20 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } -} diff --git a/tests/Responses/cart/create_validation_fail_response.json b/tests/Responses/cart/create_validation_fail_response.json deleted file mode 100644 index 4ed0dc91b76..00000000000 --- a/tests/Responses/cart/create_validation_fail_response.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "customer": { - "errors": [ - "This value should not be blank." - ] - }, - "localeCode": { - "errors": [ - "This value should not be blank." - ] - }, - "channel": { - "errors": [ - "This value should not be blank." - ] - } - } - } -} diff --git a/tests/Responses/cart/empty_index_response.json b/tests/Responses/cart/empty_index_response.json deleted file mode 100644 index ea4ca645739..00000000000 --- a/tests/Responses/cart/empty_index_response.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 0, - "_links": { - "self": { - "href": "\/api\/v1\/carts\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/carts\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/carts\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - ] - } -} diff --git a/tests/Responses/cart/increase_quantity_response.json b/tests/Responses/cart/increase_quantity_response.json deleted file mode 100644 index 5ba77ba2d48..00000000000 --- a/tests/Responses/cart/increase_quantity_response.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "id": @integer@, - "items": [ - { - "id": @integer@, - "quantity": 3, - "unitPrice": 20, - "total": 60, - "units": [ - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - }, - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - }, - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - } - ], - "unitsTotal": 60, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "tracked": false, - "channelPricings": { - "WEB": { - "channelCode": "WEB", - "price": 20 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - }, - { - "id": @integer@, - "quantity": 1, - "unitPrice": 20, - "total": 20, - "units": [ - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - } - ], - "unitsTotal": 20, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "HARD_AVAILABLE_MUG", - "optionValues": [], - "position": 3, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Breaking bad mug" - } - }, - "version": 1, - "tracked": true, - "channelPricings": { - "WEB": { - "channelCode": "WEB", - "price": 20 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/HARD_AVAILABLE_MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/HARD_AVAILABLE_MUG" - } - } - } - ], - "itemsTotal": 80, - "adjustments": [], - "adjustmentsTotal": 0, - "total": 80, - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "WEB", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/WEB" - } - } - }, - "currencyCode": "USD", - "localeCode": "en_US", - "checkoutState": "cart" -} diff --git a/tests/Responses/cart/index_response.json b/tests/Responses/cart/index_response.json deleted file mode 100644 index db1221306d1..00000000000 --- a/tests/Responses/cart/index_response.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 1, - "_links": { - "self": { - "href": "\/api\/v1\/carts\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/carts\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/carts\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "items": [], - "itemsTotal": 0, - "adjustments": [], - "adjustmentsTotal": 0, - "total": 0, - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "WEB", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "currencyCode": "USD", - "localeCode": "en_US", - "checkoutState": "cart" - } - ] - } -} diff --git a/tests/Responses/cart/recalculated_items_total_response.json b/tests/Responses/cart/recalculated_items_total_response.json deleted file mode 100644 index 0035210b6e1..00000000000 --- a/tests/Responses/cart/recalculated_items_total_response.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "id": @integer@, - "items": [ - { - "id": @integer@, - "quantity": 2, - "unitPrice": 20, - "total": 40, - "units": [ - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - }, - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - } - ], - "unitsTotal": 40, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "tracked": false, - "channelPricings": { - "WEB": { - "channelCode": "WEB", - "price": 20 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 40, - "adjustments": [], - "adjustmentsTotal": 0, - "total": 40, - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "WEB", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/WEB" - } - } - }, - "currencyCode": "USD", - "localeCode": "en_US", - "checkoutState": "cart" -} diff --git a/tests/Responses/cart/show_response.json b/tests/Responses/cart/show_response.json deleted file mode 100644 index 5ebbbf74e1d..00000000000 --- a/tests/Responses/cart/show_response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": @integer@, - "items": [], - "itemsTotal": 0, - "adjustments": [], - "adjustmentsTotal": 0, - "total": 0, - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "WEB", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "currencyCode": "USD", - "localeCode": "en_US", - "checkoutState": "cart" -} diff --git a/tests/Responses/cart/update_cart_item_validation_fail_response.json b/tests/Responses/cart/update_cart_item_validation_fail_response.json deleted file mode 100644 index 276a084965e..00000000000 --- a/tests/Responses/cart/update_cart_item_validation_fail_response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "errors": [ - "This form should not contain extra fields." - ], - "children": { - "quantity": { - - } - } - } -} diff --git a/tests/Responses/cart/update_hard_available_cart_item_validation_error_response.json b/tests/Responses/cart/update_hard_available_cart_item_validation_error_response.json deleted file mode 100644 index 0c6c1f1ec92..00000000000 --- a/tests/Responses/cart/update_hard_available_cart_item_validation_error_response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "code":400, - "message":"Validation Failed", - "errors":{ - "errors":[ - "Mug does not have sufficient stock." - ], - "children":{ - "quantity":{ - - } - } - } -} diff --git a/tests/Responses/channel/create_response.json b/tests/Responses/channel/create_response.json deleted file mode 100644 index e8ffaafadc4..00000000000 --- a/tests/Responses/channel/create_response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": @integer@, - "code": "mob", - "name": "Channel for mobile", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": @string@ - } - } -} diff --git a/tests/Responses/channel/create_validation_fail_response.json b/tests/Responses/channel/create_validation_fail_response.json deleted file mode 100644 index bfc69b0854b..00000000000 --- a/tests/Responses/channel/create_validation_fail_response.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "name": { - "errors": [ - "Please enter channel name." - ] - }, - "description": {}, - "enabled": { - "errors": [ - "Must have at least one enabled entity" - ] - }, - "hostname": {}, - "color": {}, - "locales": {}, - "defaultLocale": { - "errors": [ - "Please enter channel default locale." - ] - }, - "currencies": {}, - "countries": {}, - "defaultTaxZone": {}, - "taxCalculationStrategy": { - "errors": [ - "This value should not be blank." - ] - }, - "themeName": {}, - "contactEmail": {}, - "skippingShippingStepAllowed": {}, - "skippingPaymentStepAllowed": {}, - "accountVerificationRequired": {}, - "shopBillingData": { - "children": { - "taxId": {}, - "company": {}, - "countryCode": {}, - "street": {}, - "city": {}, - "postcode": {} - } - }, - "menuTaxon": {}, - "code": { - "errors": [ - "Please enter channel code." - ] - }, - "baseCurrency": { - "errors": [ - "Please enter channel base currency." - ] - } - } - } -} diff --git a/tests/Responses/channel/create_with_extra_response.json b/tests/Responses/channel/create_with_extra_response.json deleted file mode 100644 index 713b36865e4..00000000000 --- a/tests/Responses/channel/create_with_extra_response.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "id": @integer@, - "code": "android", - "name": "Channel for Android client", - "description": "For now not required, for future development stages.", - "hostname": "quickmart.eu", - "color": "ClassicBlue", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "menuTaxon": { - "id": @integer@, - "code": "mugs", - "root": { - "id": @integer@, - "code": "category", - "children": { - "1": { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "2": { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "3": { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - }, - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "children": { - "1": { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "2": { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "3": { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - }, - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "_links": { - "self": { - "href": @string@ - } - } -} diff --git a/tests/Responses/channel/index_response.json b/tests/Responses/channel/index_response.json deleted file mode 100644 index 0d66df2c33e..00000000000 --- a/tests/Responses/channel/index_response.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 2, - "_links": { - "self": { - "href": "\/api\/v1\/channels\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/channels\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/channels\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "WEB", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/WEB" - } - } - }, - { - "id": @integer@, - "code": "MOB", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/MOB" - } - } - } - ] - } -} diff --git a/tests/Responses/channel/show_response.json b/tests/Responses/channel/show_response.json deleted file mode 100644 index a623aa975ca..00000000000 --- a/tests/Responses/channel/show_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": @integer@, - "code": "WEB", - "name": "Web Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/channel/update_response.json b/tests/Responses/channel/update_response.json deleted file mode 100644 index a5535d8ae92..00000000000 --- a/tests/Responses/channel/update_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": @integer@, - "code": "WEB", - "name": "Web Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": false, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/WEB" - } - } -} diff --git a/tests/Responses/channel/update_validation_fail_response.json b/tests/Responses/channel/update_validation_fail_response.json deleted file mode 100644 index 7730ef2b154..00000000000 --- a/tests/Responses/channel/update_validation_fail_response.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "name": { - "errors": [ - "Please enter channel name." - ] - }, - "description": {}, - "enabled": {}, - "hostname": {}, - "color": {}, - "locales": {}, - "defaultLocale": {}, - "currencies": {}, - "countries": {}, - "defaultTaxZone": {}, - "taxCalculationStrategy": { - "errors": [ - "This value should not be blank." - ] - }, - "themeName": {}, - "contactEmail": {}, - "skippingShippingStepAllowed": {}, - "skippingPaymentStepAllowed": {}, - "accountVerificationRequired": {}, - "shopBillingData": { - "children": { - "taxId": {}, - "company": {}, - "countryCode": {}, - "street": {}, - "city": {}, - "postcode": {} - } - }, - "menuTaxon": {}, - "code": {}, - "baseCurrency": {} - } - } -} diff --git a/tests/Responses/checkout/addressed_order_response.json b/tests/Responses/checkout/addressed_order_response.json deleted file mode 100644 index 78bf2f039a2..00000000000 --- a/tests/Responses/checkout/addressed_order_response.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "id": @integer@, - "items": @array@, - "itemsTotal": @integer@, - "adjustments": @array@, - "adjustmentsTotal": @integer@, - "total": @integer@, - "state": "cart", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": @string@ - } - } - }, - "billingAddress": { - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "’s-Hertogenbosch", - "postcode": "99-999" - }, - "shippingAddress": { - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": @array@, - "shipments": @array@, - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "addressed" -} diff --git a/tests/Responses/checkout/addressing_invalid_customer.json b/tests/Responses/checkout/addressing_invalid_customer.json deleted file mode 100644 index 497b2a4f5d1..00000000000 --- a/tests/Responses/checkout/addressing_invalid_customer.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "shippingAddress": { - "children": { - "firstName": { - "errors": [ - "Please enter first name." - ] - }, - "lastName": { - "errors": [ - "Please enter last name." - ] - }, - "phoneNumber": {}, - "company": {}, - "countryCode": { - "errors": [ - "Please select country." - ] - }, - "street": { - "errors": [ - "Please enter street." - ] - }, - "city": { - "errors": [ - "Please enter city." - ] - }, - "postcode": { - "errors": [ - "Please enter postcode." - ] - } - } - }, - "billingAddress": { - "children": { - "firstName": { - "errors": [ - "Please enter first name." - ] - }, - "lastName": { - "errors": [ - "Please enter last name." - ] - }, - "phoneNumber": {}, - "company": {}, - "countryCode": { - "errors": [ - "Please select country." - ] - }, - "street": { - "errors": [ - "Please enter street." - ] - }, - "city": { - "errors": [ - "Please enter city." - ] - }, - "postcode": { - "errors": [ - "Please enter postcode." - ] - } - } - }, - "differentShippingAddress": {} - } - } -} diff --git a/tests/Responses/checkout/addressing_validation_failed_billing_address.json b/tests/Responses/checkout/addressing_validation_failed_billing_address.json deleted file mode 100644 index a57775f784f..00000000000 --- a/tests/Responses/checkout/addressing_validation_failed_billing_address.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "billingAddress": { - "children": { - "firstName": {}, - "lastName": {}, - "phoneNumber": {}, - "company": {}, - "countryCode": {}, - "street": {}, - "city": {}, - "postcode": {}, - "provinceName": {} - } - }, - "shippingAddress": { - "children": { - "firstName": { - "errors": [ - "Please enter first name." - ] - }, - "lastName": { - "errors": [ - "Please enter last name." - ] - }, - "phoneNumber": {}, - "company": {}, - "countryCode": { - "errors": [ - "Please select country." - ] - }, - "street": { - "errors": [ - "Please enter street." - ] - }, - "city": { - "errors": [ - "Please enter city." - ] - }, - "postcode": { - "errors": [ - "Please enter postcode." - ] - } - } - }, - "differentBillingAddress": {}, - "differentShippingAddress": {} - } - } -} diff --git a/tests/Responses/checkout/addressing_validation_failed_shipping_address.json b/tests/Responses/checkout/addressing_validation_failed_shipping_address.json deleted file mode 100644 index b213b3b3d7c..00000000000 --- a/tests/Responses/checkout/addressing_validation_failed_shipping_address.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "billingAddress": { - "children": { - "firstName": { - "errors": [ - "Please enter first name." - ] - }, - "lastName": { - "errors": [ - "Please enter last name." - ] - }, - "phoneNumber": {}, - "company": {}, - "countryCode": { - "errors": [ - "Please select country." - ] - }, - "street": { - "errors": [ - "Please enter street." - ] - }, - "city": { - "errors": [ - "Please enter city." - ] - }, - "postcode": { - "errors": [ - "Please enter postcode." - ] - } - } - }, - "shippingAddress": { - "children": { - "firstName": { - "errors": [ - "Please enter first name." - ] - }, - "lastName": { - "errors": [ - "Please enter last name." - ] - }, - "phoneNumber": {}, - "company": {}, - "countryCode": { - "errors": [ - "Please select country." - ] - }, - "street": { - "errors": [ - "Please enter street." - ] - }, - "city": { - "errors": [ - "Please enter city." - ] - }, - "postcode": { - "errors": [ - "Please enter postcode." - ] - } - } - }, - "differentBillingAddress": {}, - "differentShippingAddress": {} - } - } -} diff --git a/tests/Responses/checkout/complete_invalid_order_state.json b/tests/Responses/checkout/complete_invalid_order_state.json deleted file mode 100644 index 9dc0c1ca105..00000000000 --- a/tests/Responses/checkout/complete_invalid_order_state.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code": 500, - "message": "Transition \"complete\" cannot be applied on state \"shipping_selected\" of object \"Sylius\\Component\\Core\\Model\\Order\" with graph \"sylius_order_checkout\"" -} diff --git a/tests/Responses/checkout/complete_validation_failed_disabled_product.json b/tests/Responses/checkout/complete_validation_failed_disabled_product.json deleted file mode 100644 index 58bb3f0df61..00000000000 --- a/tests/Responses/checkout/complete_validation_failed_disabled_product.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "errors": [ - "This product Mug has been disabled." - ], - "children": { - "notes": {} - } - } -} diff --git a/tests/Responses/checkout/complete_validation_failed_insufficient_stock.json b/tests/Responses/checkout/complete_validation_failed_insufficient_stock.json deleted file mode 100644 index 94374c03cb7..00000000000 --- a/tests/Responses/checkout/complete_validation_failed_insufficient_stock.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "errors": [ - "Mug does not have sufficient stock." - ], - "children": { - "notes": {} - } - } -} diff --git a/tests/Responses/checkout/completed_order_response.json b/tests/Responses/checkout/completed_order_response.json deleted file mode 100644 index a52a6cb2e0c..00000000000 --- a/tests/Responses/checkout/completed_order_response.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": @string@, - "items": @array@, - "itemsTotal": @integer@, - "adjustments": @array@, - "adjustmentsTotal": @integer@, - "total": @integer@, - "state": "new", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": @string@ - } - } - }, - "shippingAddress": @...@, - "billingAddress": @...@, - "payments": @array@, - "shipments": @array@, - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "completed" -} diff --git a/tests/Responses/checkout/get_available_payment_methods.json b/tests/Responses/checkout/get_available_payment_methods.json deleted file mode 100644 index 6823522f6ea..00000000000 --- a/tests/Responses/checkout/get_available_payment_methods.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "payments": [ - { - "methods": [ - { - "id": @integer@, - "code": "cod", - "name": "Cash on delivery", - "description": "@string@" - }, - { - "id": @integer@, - "code": "pbc", - "name": "Pay by check", - "description": "@string@" - } - ] - } - ] -} diff --git a/tests/Responses/checkout/get_available_payment_methods_failed.json b/tests/Responses/checkout/get_available_payment_methods_failed.json deleted file mode 100644 index aa678d06134..00000000000 --- a/tests/Responses/checkout/get_available_payment_methods_failed.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code": 400, - "message": "The payment methods cannot be resolved in the current state of cart!" -} diff --git a/tests/Responses/checkout/get_available_shipping_methods.json b/tests/Responses/checkout/get_available_shipping_methods.json deleted file mode 100644 index b21274ce392..00000000000 --- a/tests/Responses/checkout/get_available_shipping_methods.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "shipments": [ - { - "methods": [ - { - "id": @integer@, - "code": "UPS", - "name": "UPS", - "description": "@string@", - "price": 1000 - }, - { - "id": @integer@, - "code": "DHL", - "name": "DHL", - "description": "@string@", - "price": 2000 - } - ] - } - ] -} diff --git a/tests/Responses/checkout/get_available_shipping_methods_failed.json b/tests/Responses/checkout/get_available_shipping_methods_failed.json deleted file mode 100644 index a4f01e7a5ce..00000000000 --- a/tests/Responses/checkout/get_available_shipping_methods_failed.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code": 400, - "message": "The shipment methods cannot be resolved in the current state of cart!" -} diff --git a/tests/Responses/checkout/payment_invalid_order_state.json b/tests/Responses/checkout/payment_invalid_order_state.json deleted file mode 100644 index c8262217972..00000000000 --- a/tests/Responses/checkout/payment_invalid_order_state.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code": 500, - "message": "Transition \"select_payment\" cannot be applied on state \"addressed\" of object \"Sylius\\Component\\Core\\Model\\Order\" with graph \"sylius_order_checkout\"" -} diff --git a/tests/Responses/checkout/payment_selected_order_response.json b/tests/Responses/checkout/payment_selected_order_response.json deleted file mode 100644 index 5089d722d64..00000000000 --- a/tests/Responses/checkout/payment_selected_order_response.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "id": @integer@, - "items": @array@, - "itemsTotal": @integer@, - "adjustments": @array@, - "adjustmentsTotal": @integer@, - "total": @integer@, - "state": "cart", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": @string@ - } - } - }, - "shippingAddress": @...@, - "billingAddress": @...@, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "Cash on delivery", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": @string@ - } - } - }, - "amount": @integer@, - "state": "new", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": @string@ - }, - "payment-method": { - "href": @string@ - }, - "order": { - "href": @string@ - } - } - } - ], - "shipments": @array@, - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "payment_selected" -} diff --git a/tests/Responses/checkout/payment_validation_failed.json b/tests/Responses/checkout/payment_validation_failed.json deleted file mode 100644 index e8a6f943132..00000000000 --- a/tests/Responses/checkout/payment_validation_failed.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "payments": { - "children": [ - { - "children": { - "method": { - "errors": [ - "This value is not valid." - ], - "children": [ - {}, - {} - ] - } - } - } - ] - } - } - } -} diff --git a/tests/Responses/checkout/shipping_invalid_order_state.json b/tests/Responses/checkout/shipping_invalid_order_state.json deleted file mode 100644 index b5a839e5ca8..00000000000 --- a/tests/Responses/checkout/shipping_invalid_order_state.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "shipments": { - "children": [ - { - "children": { - "method": { - "errors": [ - "Please select shipping method." - ], - "children": [ - {}, - {} - ] - } - } - } - ] - } - } - } -} diff --git a/tests/Responses/checkout/shipping_selected_order_response.json b/tests/Responses/checkout/shipping_selected_order_response.json deleted file mode 100644 index edde4bff3d1..00000000000 --- a/tests/Responses/checkout/shipping_selected_order_response.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "id": @integer@, - "items": @array@, - "itemsTotal": @integer@, - "adjustments": @array@, - "adjustmentsTotal": @integer@, - "total": @integer@, - "state": "cart", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": @string@ - } - } - }, - "shippingAddress": @...@, - "billingAddress": @...@, - "payments": @array@, - "shipments": [ - { - "id": @integer@, - "state": "cart", - "method": { - "id": @integer@, - "code": "UPS", - "categoryRequirement": 1, - "calculator": "flat_rate", - "configuration": { - "CHANNEL": { - "amount": 10 - } - }, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": @string@ - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": @string@ - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "shipping_selected" -} diff --git a/tests/Responses/checkout/shipping_validation_failed.json b/tests/Responses/checkout/shipping_validation_failed.json deleted file mode 100644 index 4d0cd146178..00000000000 --- a/tests/Responses/checkout/shipping_validation_failed.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "shipments": { - "children": [ - { - "children": { - "method": { - "errors": [ - "This value is not valid." - ], - "children": [ - {}, - {} - ] - } - } - } - ] - } - } - } -} diff --git a/tests/Responses/country/create_response.json b/tests/Responses/country/create_response.json deleted file mode 100644 index bd0c49a341f..00000000000 --- a/tests/Responses/country/create_response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": @integer@, - "code": "BE", - "provinces": [], - "enabled": false, - "_links": { - "self": { - "href": @string@ - } - } -} diff --git a/tests/Responses/country/create_validation_fail_response.json b/tests/Responses/country/create_validation_fail_response.json deleted file mode 100644 index 9145ba44d5c..00000000000 --- a/tests/Responses/country/create_validation_fail_response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "provinces": {}, - "enabled": {}, - "code": { - "errors": [ - "Please enter country ISO code." - ] - } - } - } -} diff --git a/tests/Responses/country/create_with_province_response.json b/tests/Responses/country/create_with_province_response.json deleted file mode 100644 index 5656c27db5e..00000000000 --- a/tests/Responses/country/create_with_province_response.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "id": @integer@, - "code": "BE", - "provinces": [ - { - "id": @integer@, - "code": "BE-LM", - "name": "Limburg", - "_links": { - "self": { - "href": "\/api\/v1\/countries\/BE\/provinces\/BE-LM" - }, - "country": { - "href": "\/api\/v1\/countries\/BE" - } - } - } - ], - "enabled": false, - "_links": { - "self": { - "href": "\/api\/v1\/countries\/BE" - } - } -} diff --git a/tests/Responses/country/index_response.json b/tests/Responses/country/index_response.json deleted file mode 100644 index 0955af376b7..00000000000 --- a/tests/Responses/country/index_response.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 3, - "_links": { - "self": { - "href": "\/api\/v1\/countries\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/countries\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/countries\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "NL", - "_links": { - "self": { - "href": "\/api\/v1\/countries\/NL" - } - } - }, - { - "id": @integer@, - "code": "BE", - "_links": { - "self": { - "href": "\/api\/v1\/countries\/BE" - } - } - }, - { - "id": @integer@, - "code": "PL", - "_links": { - "self": { - "href": "\/api\/v1\/countries\/PL" - } - } - } - ] - } -} diff --git a/tests/Responses/country/show_response.json b/tests/Responses/country/show_response.json deleted file mode 100644 index a60af9889f7..00000000000 --- a/tests/Responses/country/show_response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": @integer@, - "code": "NL", - "provinces": [], - "enabled": true, - "_links": { - "self": { - "href": @string@ - } - } - -} diff --git a/tests/Responses/currency/create_response.json b/tests/Responses/currency/create_response.json deleted file mode 100644 index a7047199fbd..00000000000 --- a/tests/Responses/currency/create_response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": @integer@, - "code": "USD", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/USD" - } - } -} diff --git a/tests/Responses/currency/create_validation_fail_response.json b/tests/Responses/currency/create_validation_fail_response.json deleted file mode 100644 index 85d6e41b8e2..00000000000 --- a/tests/Responses/currency/create_validation_fail_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "code": { - "errors": [ - "Please choose currency code." - ] - } - } - } -} diff --git a/tests/Responses/currency/index_response.json b/tests/Responses/currency/index_response.json deleted file mode 100644 index a1cafa8afec..00000000000 --- a/tests/Responses/currency/index_response.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 3, - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/currencies\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/currencies\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "USD", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/USD" - } - } - }, - { - "id": @integer@, - "code": "EUR", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/EUR" - } - } - }, - { - "id": @integer@, - "code": "GBP", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/GBP" - } - } - } - ] - } -} diff --git a/tests/Responses/currency/show_response.json b/tests/Responses/currency/show_response.json deleted file mode 100644 index a7047199fbd..00000000000 --- a/tests/Responses/currency/show_response.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "id": @integer@, - "code": "USD", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/USD" - } - } -} diff --git a/tests/Responses/customer/create_response.json b/tests/Responses/customer/create_response.json deleted file mode 100644 index 1d81b78b422..00000000000 --- a/tests/Responses/customer/create_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "email": "john.diggle@yahoo.com", - "emailCanonical": "john.diggle@yahoo.com", - "firstName": "John", - "lastName": "Diggle", - "gender": "m", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/customer/create_validation_fail_response.json b/tests/Responses/customer/create_validation_fail_response.json deleted file mode 100644 index 3efb77e96d8..00000000000 --- a/tests/Responses/customer/create_validation_fail_response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "firstName": {}, - "lastName": {}, - "email": { - "errors": [ - "Please enter your email." - ] - }, - "birthday": {}, - "gender": {}, - "phoneNumber": {}, - "subscribedToNewsletter": {}, - "group": {} - } - } -} diff --git a/tests/Responses/customer/create_with_user_response.json b/tests/Responses/customer/create_with_user_response.json deleted file mode 100644 index 9dcf315154d..00000000000 --- a/tests/Responses/customer/create_with_user_response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": @integer@, - "user": { - "id": @integer@, - "username": "john.diggle@yahoo.com", - "usernameCanonical": "john.diggle@yahoo.com", - "roles": [ - "ROLE_USER" - ], - "enabled": false - }, - "email": "john.diggle@yahoo.com", - "emailCanonical": "john.diggle@yahoo.com", - "firstName": "John", - "lastName": "Diggle", - "gender": "m", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/customer/create_with_user_validation_fail_response.json b/tests/Responses/customer/create_with_user_validation_fail_response.json deleted file mode 100644 index 01438c424b1..00000000000 --- a/tests/Responses/customer/create_with_user_validation_fail_response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "firstName": {}, - "lastName": {}, - "email": { - "errors": [ - "Please enter your email." - ] - }, - "birthday": {}, - "gender": {}, - "phoneNumber": {}, - "subscribedToNewsletter": {}, - "group": {}, - "user": { - "children": { - "plainPassword": { - "errors": [ - "Please enter your password." - ] - }, - "enabled": {} - } - } - } - } -} diff --git a/tests/Responses/customer/index_response.json b/tests/Responses/customer/index_response.json deleted file mode 100644 index bbcb97f64a0..00000000000 --- a/tests/Responses/customer/index_response.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 5, - "_links": { - "self": { - "href": "\/api\/v1\/customers\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/customers\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/customers\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "email": "Joe@doe.com", - "firstName": "Joe", - "lastName": "Doe", - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "email": "Barry@doe.com", - "firstName": "Barry", - "lastName": "Doe", - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "user": { - "id": @integer@, - "username": "Thea@doe.com", - "enabled": true - }, - "email": "Thea@doe.com", - "firstName": "Thea", - "lastName": "Doe", - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "user": { - "id": @integer@, - "username": "Roy@doe.com", - "enabled": true - }, - "email": "Roy@doe.com", - "firstName": "Roy", - "lastName": "Doe", - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "user": { - "id": @integer@, - "username": "Oliver@doe.com", - "enabled": true - }, - "email": "Oliver@doe.com", - "firstName": "Oliver", - "lastName": "Doe", - "_links": { - "self": { - "href": "@string@" - } - } - } - ] - } -} diff --git a/tests/Responses/customer/page_not_found_response.json b/tests/Responses/customer/page_not_found_response.json deleted file mode 100644 index 0c28fc98c7a..00000000000 --- a/tests/Responses/customer/page_not_found_response.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code": 404, - "message": "Page Not Found" -} diff --git a/tests/Responses/customer/partial_update_response.json b/tests/Responses/customer/partial_update_response.json deleted file mode 100644 index a436f0b0210..00000000000 --- a/tests/Responses/customer/partial_update_response.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "id": @integer@, - "user": { - "id": @integer@, - "username": "Oliver@doe.com", - "usernameCanonical": "oliver@doe.com", - "roles": [ - "ROLE_USER" - ], - "enabled": true - }, - "email": "Oliver@doe.com", - "emailCanonical": "oliver@doe.com", - "firstName": "John", - "lastName": "Doe", - "gender": "u", - "birthday": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/customer/show_response.json b/tests/Responses/customer/show_response.json deleted file mode 100644 index b3529760ab9..00000000000 --- a/tests/Responses/customer/show_response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": @integer@, - "email": "Barry@doe.com", - "emailCanonical": "barry@doe.com", - "firstName": "Barry", - "lastName": "Doe", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/customer/show_with_user_response.json b/tests/Responses/customer/show_with_user_response.json deleted file mode 100644 index a96e5e3f659..00000000000 --- a/tests/Responses/customer/show_with_user_response.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "id": @integer@, - "user": { - "id": @integer@, - "username": "Roy@doe.com", - "usernameCanonical": "roy@doe.com", - "roles": [ - "ROLE_USER" - ], - "enabled": true - }, - "email": "Roy@doe.com", - "emailCanonical": "roy@doe.com", - "firstName": "Roy", - "lastName": "Doe", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/customer/update_response.json b/tests/Responses/customer/update_response.json deleted file mode 100644 index 44d7968b256..00000000000 --- a/tests/Responses/customer/update_response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": @integer@, - "user": { - "id": @integer@, - "username": "john.diggle@example.com", - "usernameCanonical": "john.diggle@example.com", - "roles": [ - "ROLE_USER" - ], - "enabled": true - }, - "email": "john.diggle@example.com", - "emailCanonical": "john.diggle@example.com", - "firstName": "John", - "lastName": "Diggle", - "gender": "m", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/customer/update_validation_fail_response.json b/tests/Responses/customer/update_validation_fail_response.json deleted file mode 100644 index 3efb77e96d8..00000000000 --- a/tests/Responses/customer/update_validation_fail_response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "firstName": {}, - "lastName": {}, - "email": { - "errors": [ - "Please enter your email." - ] - }, - "birthday": {}, - "gender": {}, - "phoneNumber": {}, - "subscribedToNewsletter": {}, - "group": {} - } - } -} diff --git a/tests/Responses/error/not_found_response.json b/tests/Responses/error/not_found_response.json deleted file mode 100644 index e083210675b..00000000000 --- a/tests/Responses/error/not_found_response.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code": 404, - "message": @string@ -} diff --git a/tests/Responses/exchange_rate/create_response.json b/tests/Responses/exchange_rate/create_response.json deleted file mode 100644 index 0f487a62371..00000000000 --- a/tests/Responses/exchange_rate/create_response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": @integer@, - "ratio": 0.85157, - "sourceCurrency": { - "id": @integer@, - "code": "EUR", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/EUR" - } - } - }, - "targetCurrency": { - "id": @integer@, - "code": "GBP", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/GBP" - } - } - }, - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/exchange-rates\/EUR-GBP" - } - } -} diff --git a/tests/Responses/exchange_rate/create_validation_fail_response.json b/tests/Responses/exchange_rate/create_validation_fail_response.json deleted file mode 100644 index de9442309d5..00000000000 --- a/tests/Responses/exchange_rate/create_validation_fail_response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "errors": [ - "The source and target currencies must differ." - ], - "children": { - "ratio": { - "errors": [ - "Please enter exchange rate ratio." - ] - }, - "sourceCurrency": { - "errors": [ - "This value is not valid." - ] - }, - "targetCurrency": { - "errors": [ - "This value is not valid." - ] - } - } - } -} diff --git a/tests/Responses/exchange_rate/index_response.json b/tests/Responses/exchange_rate/index_response.json deleted file mode 100644 index cf9de7b5dc7..00000000000 --- a/tests/Responses/exchange_rate/index_response.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 3, - "_links": { - "self": { - "href": "\/api\/v1\/exchange-rates\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/exchange-rates\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/exchange-rates\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "ratio": 0.85, - "sourceCurrency": { - "id": @integer@, - "code": "EUR", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/EUR" - } - } - }, - "targetCurrency": { - "id": @integer@, - "code": "GBP", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/GBP" - } - } - }, - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/exchange-rates\/EUR-GBP" - } - } - }, - { - "id": @integer@, - "ratio": 1.06, - "sourceCurrency": { - "id": @integer@, - "code": "EUR", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/EUR" - } - } - }, - "targetCurrency": { - "id": @integer@, - "code": "USD", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/USD" - } - } - }, - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/exchange-rates\/EUR-USD" - } - } - }, - { - "id": @integer@, - "ratio": 1.24, - "sourceCurrency": { - "id": @integer@, - "code": "USD", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/USD" - } - } - }, - "targetCurrency": { - "id": @integer@, - "code": "GBP", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/GBP" - } - } - }, - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/exchange-rates\/USD-GBP" - } - } - } - ] - } -} diff --git a/tests/Responses/exchange_rate/non_unique_pair_validation_fail_response.json b/tests/Responses/exchange_rate/non_unique_pair_validation_fail_response.json deleted file mode 100644 index 2070d49dbb0..00000000000 --- a/tests/Responses/exchange_rate/non_unique_pair_validation_fail_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "errors": [ - "The currency pair must be unique." - ], - "children": { - "ratio": { - }, - "sourceCurrency": { - }, - "targetCurrency": { - } - } - } -} diff --git a/tests/Responses/exchange_rate/show_response.json b/tests/Responses/exchange_rate/show_response.json deleted file mode 100644 index 6de24726692..00000000000 --- a/tests/Responses/exchange_rate/show_response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": @integer@, - "ratio": 0.85, - "sourceCurrency": { - "id": @integer@, - "code": "EUR", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/EUR" - } - } - }, - "targetCurrency": { - "id": @integer@, - "code": "GBP", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/GBP" - } - } - }, - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/exchange-rates\/EUR-GBP" - } - } -} diff --git a/tests/Responses/exchange_rate/update_ratio_with_string_validation_fail_response.json b/tests/Responses/exchange_rate/update_ratio_with_string_validation_fail_response.json deleted file mode 100644 index b78043ed286..00000000000 --- a/tests/Responses/exchange_rate/update_ratio_with_string_validation_fail_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "ratio": { - "errors": [ - "The ratio must be a number." - ] - }, - "sourceCurrency": { - }, - "targetCurrency": { - } - } - } -} diff --git a/tests/Responses/exchange_rate/update_response.json b/tests/Responses/exchange_rate/update_response.json deleted file mode 100644 index 9733ab284b7..00000000000 --- a/tests/Responses/exchange_rate/update_response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": @integer@, - "ratio": 0.84, - "sourceCurrency": { - "id": @integer@, - "code": "EUR", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/EUR" - } - } - }, - "targetCurrency": { - "id": @integer@, - "code": "USD", - "_links": { - "self": { - "href": "\/api\/v1\/currencies\/USD" - } - } - }, - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/exchange-rates\/EUR-USD" - } - } -} diff --git a/tests/Responses/exchange_rate/update_validation_fail_response.json b/tests/Responses/exchange_rate/update_validation_fail_response.json deleted file mode 100644 index d93df246abb..00000000000 --- a/tests/Responses/exchange_rate/update_validation_fail_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "ratio": { - "errors": [ - "Please enter exchange rate ratio." - ] - }, - "sourceCurrency": { - }, - "targetCurrency": { - } - } - } -} diff --git a/tests/Responses/locale/create_response.json b/tests/Responses/locale/create_response.json deleted file mode 100644 index f298956e3ad..00000000000 --- a/tests/Responses/locale/create_response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": @integer@, - "code": "es_ES", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/locales\/es_ES" - } - } -} diff --git a/tests/Responses/locale/create_validation_fail_response.json b/tests/Responses/locale/create_validation_fail_response.json deleted file mode 100644 index 45a49021bbd..00000000000 --- a/tests/Responses/locale/create_validation_fail_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "code": { - "errors": [ - "Please choose locale code." - ] - } - } - } -} diff --git a/tests/Responses/locale/index_response.json b/tests/Responses/locale/index_response.json deleted file mode 100644 index 3265503884d..00000000000 --- a/tests/Responses/locale/index_response.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 4, - "_links": { - "self": { - "href": "\/api\/v1\/locales\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/locales\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/locales\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "en_US", - "_links": { - "self": { - "href": "\/api\/v1\/locales\/en_US" - } - } - }, - { - "id": @integer@, - "code": "nl_NL", - "_links": { - "self": { - "href": "\/api\/v1\/locales\/nl_NL" - } - } - }, - { - "id": @integer@, - "code": "fr_FR", - "_links": { - "self": { - "href": "\/api\/v1\/locales\/fr_FR" - } - } - }, - { - "id": @integer@, - "code": "de_CH", - "_links": { - "self": { - "href": "\/api\/v1\/locales\/de_CH" - } - } - } - ] - } -} diff --git a/tests/Responses/locale/show_response.json b/tests/Responses/locale/show_response.json deleted file mode 100644 index 119091887dc..00000000000 --- a/tests/Responses/locale/show_response.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "id": @integer@, - "code": "en_US", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/locales\/en_US" - } - } -} diff --git a/tests/Responses/locale/update_response.json b/tests/Responses/locale/update_response.json deleted file mode 100644 index 1e4f39381b5..00000000000 --- a/tests/Responses/locale/update_response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "id": @integer@, - "code": "en_US", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" -} diff --git a/tests/Responses/order/cart_show_response.json b/tests/Responses/order/cart_show_response.json deleted file mode 100644 index 689ac97c923..00000000000 --- a/tests/Responses/order/cart_show_response.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "id": @integer@, - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2000, - "units": [ - { - "id": @integer@, - "adjustments": [], - "adjustmentsTotal": 0 - } - ], - "unitsTotal": 2000, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2000, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3000, - "state": "cart", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3000, - "state": "cart", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "cart", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "cart" -} diff --git a/tests/Responses/order/order_canceled_show_response.json b/tests/Responses/order/order_canceled_show_response.json deleted file mode 100644 index ad9353e4296..00000000000 --- a/tests/Responses/order/order_canceled_show_response.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": "000000001", - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2400, - "units": [ - { - "id": @integer@, - "adjustments": [ - { - "id": @integer@, - "type": "tax", - "label": "EU Regular Tax 20% (20%)", - "amount": 400 - } - ], - "adjustmentsTotal": 400 - } - ], - "unitsTotal": 2400, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2400, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3400, - "state": "cancelled", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "shippingAddress": { - "id": @integer@, - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "\u2019s-Hertogenbosch", - "postcode": "99-999" - }, - "billingAddress": { - "id": @integer@, - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3400, - "state": "cancelled", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "cancelled", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "completed" -} diff --git a/tests/Responses/order/order_fulfilled_show_response.json b/tests/Responses/order/order_fulfilled_show_response.json deleted file mode 100644 index 76f38e14269..00000000000 --- a/tests/Responses/order/order_fulfilled_show_response.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": "000000001", - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2400, - "units": [ - { - "id": @integer@, - "adjustments": [ - { - "id": @integer@, - "type": "tax", - "label": "EU Regular Tax 20% (20%)", - "amount": 400 - } - ], - "adjustmentsTotal": 400 - } - ], - "unitsTotal": 2400, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2400, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3400, - "state": "fulfilled", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "shippingAddress": { - "id": @integer@, - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "\u2019s-Hertogenbosch", - "postcode": "99-999" - }, - "billingAddress": { - "id": @integer@, - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3400, - "state": "completed", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "shipped", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "completed" -} diff --git a/tests/Responses/order/order_index_response.json b/tests/Responses/order/order_index_response.json deleted file mode 100644 index 03c53c4c2a2..00000000000 --- a/tests/Responses/order/order_index_response.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 2, - "_links": { - "self": { - "href": "\/api\/v1\/orders\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/orders\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/orders\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "items": [], - "itemsTotal": 0, - "adjustments": [], - "adjustmentsTotal": 0, - "total": 0, - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "currencyCode": "USD", - "localeCode": "en_US", - "checkoutState": "completed" - }, - { - "id": @integer@, - "items": [], - "itemsTotal": 0, - "adjustments": [], - "adjustmentsTotal": 0, - "total": 0, - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "currencyCode": "USD", - "localeCode": "en_US", - "checkoutState": "new" - } - ] - } -} diff --git a/tests/Responses/order/order_payed_show_response.json b/tests/Responses/order/order_payed_show_response.json deleted file mode 100644 index 3cfe1c5f373..00000000000 --- a/tests/Responses/order/order_payed_show_response.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": "000000001", - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2400, - "units": [ - { - "id": @integer@, - "adjustments": [ - { - "id": @integer@, - "type": "tax", - "label": "EU Regular Tax 20% (20%)", - "amount": 400 - } - ], - "adjustmentsTotal": 400 - } - ], - "unitsTotal": 2400, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2400, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3400, - "state": "new", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "shippingAddress": { - "id": @integer@, - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "\u2019s-Hertogenbosch", - "postcode": "99-999" - }, - "billingAddress": { - "id": @integer@, - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3400, - "state": "completed", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "ready", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "completed" -} diff --git a/tests/Responses/order/order_shipped_show_response.json b/tests/Responses/order/order_shipped_show_response.json deleted file mode 100644 index fcac54343cb..00000000000 --- a/tests/Responses/order/order_shipped_show_response.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": "000000001", - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2400, - "units": [ - { - "id": @integer@, - "adjustments": [ - { - "id": @integer@, - "type": "tax", - "label": "EU Regular Tax 20% (20%)", - "amount": 400 - } - ], - "adjustmentsTotal": 400 - } - ], - "unitsTotal": 2400, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2400, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3400, - "state": "new", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "shippingAddress": { - "id": @integer@, - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "\u2019s-Hertogenbosch", - "postcode": "99-999" - }, - "billingAddress": { - "id": @integer@, - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3400, - "state": "new", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "shipped", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "completed" -} diff --git a/tests/Responses/order/order_shipped_with_tracking_show_response.json b/tests/Responses/order/order_shipped_with_tracking_show_response.json deleted file mode 100644 index f48a4615bf0..00000000000 --- a/tests/Responses/order/order_shipped_with_tracking_show_response.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": "000000001", - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2400, - "units": [ - { - "id": @integer@, - "adjustments": [ - { - "id": @integer@, - "type": "tax", - "label": "EU Regular Tax 20% (20%)", - "amount": 400 - } - ], - "adjustmentsTotal": 400 - } - ], - "unitsTotal": 2400, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2400, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3400, - "state": "new", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "shippingAddress": { - "id": @integer@, - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "\u2019s-Hertogenbosch", - "postcode": "99-999" - }, - "billingAddress": { - "id": @integer@, - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3400, - "state": "new", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "shipped", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "tracking": "BANANAS", - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "completed" -} diff --git a/tests/Responses/order/order_show_response.json b/tests/Responses/order/order_show_response.json deleted file mode 100644 index b953ea5ac5c..00000000000 --- a/tests/Responses/order/order_show_response.json +++ /dev/null @@ -1,236 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": "000000001", - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2400, - "units": [ - { - "id": @integer@, - "adjustments": [ - { - "id": @integer@, - "type": "tax", - "label": "EU Regular Tax 20% (20%)", - "amount": 400 - } - ], - "adjustmentsTotal": 400 - } - ], - "unitsTotal": 2400, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2400, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3400, - "state": "new", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "shippingAddress": { - "id": @integer@, - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "\u2019s-Hertogenbosch", - "postcode": "99-999" - }, - "billingAddress": { - "id": @integer@, - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3400, - "state": "new", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "ready", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "completed" -} diff --git a/tests/Responses/order/order_with_coupon_based_promotion_show_response.json b/tests/Responses/order/order_with_coupon_based_promotion_show_response.json deleted file mode 100644 index 4f3d5b7961f..00000000000 --- a/tests/Responses/order/order_with_coupon_based_promotion_show_response.json +++ /dev/null @@ -1,257 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": "000000001", - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2160, - "units": [ - { - "id": @integer@, - "adjustments": [ - { - "id": @integer@, - "type": "order_promotion", - "label": "Holiday promotion", - "amount": -200 - }, - { - "id": @integer@, - "type": "tax", - "label": "EU Regular Tax 20% (20%)", - "amount": 360 - } - ], - "adjustmentsTotal": 160 - } - ], - "unitsTotal": 2160, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2160, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3160, - "state": "new", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "shippingAddress": { - "id": @integer@, - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "\u2019s-Hertogenbosch", - "postcode": "99-999" - }, - "billingAddress": { - "id": @integer@, - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3160, - "state": "new", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "ready", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "promotionCoupon": { - "id": @integer@, - "code": "BANANAS", - "used": 1, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/HOLIDAY_PROMOTION\/coupons\/BANANAS" - }, - "promotion": { - "href": "\/api\/v1\/promotions\/HOLIDAY_PROMOTION" - } - } - }, - "checkoutState": "completed" -} diff --git a/tests/Responses/order/order_with_promotion_show_response.json b/tests/Responses/order/order_with_promotion_show_response.json deleted file mode 100644 index 72f53b672f9..00000000000 --- a/tests/Responses/order/order_with_promotion_show_response.json +++ /dev/null @@ -1,242 +0,0 @@ -{ - "id": @integer@, - "checkoutCompletedAt": "@string@.isDateTime()", - "number": "000000001", - "items": [ - { - "id": @integer@, - "quantity": 1, - "unitPrice": 2000, - "total": 2160, - "units": [ - { - "id": @integer@, - "adjustments": [ - { - "id": @integer@, - "type": "order_promotion", - "label": "Holiday promotion", - "amount": -200 - }, - { - "id": @integer@, - "type": "tax", - "label": "EU Regular Tax 20% (20%)", - "amount": 360 - } - ], - "adjustmentsTotal": 160 - } - ], - "unitsTotal": 2160, - "adjustments": [], - "adjustmentsTotal": 0, - "variant": { - "id": @integer@, - "code": "MUG_SW", - "optionValues": [], - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Star wars mug" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TAXABLE_GOODS", - "name": "Taxable Goods", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TAXABLE_GOODS" - } - } - }, - "channelPricings": { - "CHANNEL": { - "channelCode": "CHANNEL", - "price": 2000 - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - } - } - }, - "_links": { - "order": { - "href": "@string@" - }, - "product": { - "href": "\/api\/v1\/products\/MUG" - }, - "variant": { - "href": "\/api\/v1\/products\/MUG\/variants\/MUG_SW" - } - } - } - ], - "itemsTotal": 2160, - "adjustments": [ - { - "id": @integer@, - "type": "shipping", - "label": "UPS", - "amount": 1000 - } - ], - "adjustmentsTotal": 1000, - "total": 3160, - "state": "new", - "customer": { - "id": @integer@, - "email": "oliver.queen@star-city.com", - "emailCanonical": "oliver.queen@star-city.com", - "firstName": "Oliver", - "lastName": "Queen", - "birthday": "@string@.isDateTime()", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channel": { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - }, - "shippingAddress": { - "id": @integer@, - "firstName": "Hieronim", - "lastName": "Bosch", - "countryCode": "NL", - "street": "Surrealism St.", - "city": "\u2019s-Hertogenbosch", - "postcode": "99-999" - }, - "billingAddress": { - "id": @integer@, - "firstName": "Vincent", - "lastName": "van Gogh", - "countryCode": "NL", - "street": "Post-Impressionism St.", - "city": "Groot Zundert", - "postcode": "88-888" - }, - "payments": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3160, - "state": "new", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ], - "shipments": [ - { - "id": @integer@, - "state": "ready", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ], - "currencyCode": "EUR", - "localeCode": "en_US", - "checkoutState": "completed" -} diff --git a/tests/Responses/payment/payment_index_response.json b/tests/Responses/payment/payment_index_response.json deleted file mode 100644 index 4bf7cf8f8ed..00000000000 --- a/tests/Responses/payment/payment_index_response.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 1, - "_links": { - "self": { - "href": "\/api\/v1\/payments\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/payments\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/payments\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3400, - "state": "new", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } - } - ] - } -} diff --git a/tests/Responses/payment/payment_show_response.json b/tests/Responses/payment/payment_show_response.json deleted file mode 100644 index 1daa08ca430..00000000000 --- a/tests/Responses/payment/payment_show_response.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "id": @integer@, - "method": { - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "CHANNEL", - "name": "Channel", - "description": "@string@", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/CHANNEL" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } - }, - "amount": 3400, - "state": "new", - "_links": { - "self": { - "href": "@string@" - }, - "payment-method": { - "href": "\/api\/v1\/payment-methods\/cod" - }, - "order": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/payment_method/show_response.json b/tests/Responses/payment_method/show_response.json deleted file mode 100644 index c5621c5ab96..00000000000 --- a/tests/Responses/payment_method/show_response.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id": @integer@, - "code": "cod", - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Cash on delivery", - "description": "@string@" - } - }, - "channels": [ - { - "id": @integer@, - "code": "WEB", - "name": "Web Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/WEB" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/payment-methods\/cod" - } - } -} diff --git a/tests/Responses/product/create_response.json b/tests/Responses/product/create_response.json deleted file mode 100644 index 3bbe6767000..00000000000 --- a/tests/Responses/product/create_response.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "id": @integer@, - "name": "Theme Mug", - "code": "MUG_TH", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Theme Mug", - "slug": "theme-mug" - }, - "nl_NL": { - "id": @integer@, - "locale": "nl_NL", - "name": "Mok van het thema", - "slug": "mok-van-het-thema" - } - }, - "productTaxons": [], - "channels": [], - "reviews": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} diff --git a/tests/Responses/product/create_validation_fail_response.json b/tests/Responses/product/create_validation_fail_response.json deleted file mode 100644 index 6fbf594519b..00000000000 --- a/tests/Responses/product/create_validation_fail_response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "code":400, - "message":"Validation Failed", - "errors": { - "children": { - "enabled":{}, - "translations":{}, - "attributes":{}, - "associations":{}, - "channels":{}, - "mainTaxon":{}, - "productTaxons":{}, - "images":{}, - "code":{ - "errors":["Please enter product code."] - }, - "options":{} - } - } -} diff --git a/tests/Responses/product/create_with_associations_response.json b/tests/Responses/product/create_with_associations_response.json deleted file mode 100644 index 02afd80f0a6..00000000000 --- a/tests/Responses/product/create_with_associations_response.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "id": @integer@, - "name": "Theme Mug", - "code": "MUG_TH", - "attributes": [], - "options": [], - "associations": [ - { - "id": @integer@, - "type": { - "id": @integer@, - "code": "similar", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "translations": { - "en": { - "id": @integer@, - "locale": "en" - } - }, - "_links": { - "self": { - "href": "@string@" - } - } - }, - "associatedProducts": @array@ - }, - { - "id": @integer@, - "type": { - "id": @integer@, - "code": "accessories", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "translations": { - "en": { - "id": @integer@, - "locale": "en" - } - }, - "_links": { - "self": { - "href": "@string@" - } - } - }, - "associatedProducts": @array@ - } - ], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Theme Mug", - "slug": "theme-mug" - } - }, - "productTaxons": [], - "channels": [], - "reviews": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} diff --git a/tests/Responses/product/create_with_attributes_response.json b/tests/Responses/product/create_with_attributes_response.json deleted file mode 100644 index be6764d3ea2..00000000000 --- a/tests/Responses/product/create_with_attributes_response.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "id": @integer@, - "name": "Theme Mug", - "code": "MUG_TH", - "attributes": [ - { - "id": @integer@, - "code": "mug_material", - "name": "Mug collection", - "value": "concrete", - "type": "text", - "localeCode": "en_US" - }, - { - "id": @integer@, - "code": "mug_collection", - "name": "Mug material", - "value": "make life harder", - "type": "text", - "localeCode": "en_US" - } - ], - "options": [], - "associations": [], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Theme Mug", - "slug": "theme-mug" - } - }, - "productTaxons": [], - "channels": [], - "reviews": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} diff --git a/tests/Responses/product/create_with_channels_response.json b/tests/Responses/product/create_with_channels_response.json deleted file mode 100644 index 93b3c0ea89a..00000000000 --- a/tests/Responses/product/create_with_channels_response.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "id": @integer@, - "name": "Theme Mug", - "code": "MUG_TH", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Theme Mug", - "slug": "theme-mug" - } - }, - "productTaxons": [], - "channels": [ - { - "id": @integer@, - "code": "WEB", - "name": "Web Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/WEB" - } - } - }, - { - "id": @integer@, - "code": "MOB", - "name": "Mobile Channel", - "description": "Lorem ipsum psore", - "hostname": "localhost", - "color": "yellow", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/MOB" - } - } - } - ], - "reviews": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} \ No newline at end of file diff --git a/tests/Responses/product/create_with_images_response.json b/tests/Responses/product/create_with_images_response.json deleted file mode 100644 index e48cb609fed..00000000000 --- a/tests/Responses/product/create_with_images_response.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "id": @integer@, - "name": "Theme Mug", - "code": "MUG_TH", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Theme Mug", - "slug": "theme-mug" - } - }, - "productTaxons": [], - "channels": [], - "reviews": [], - "averageRating": 0, - "images": [ - { - "id": @integer@, - "type": "FORD_MUG", - "path": "@string@" - }, - { - "id": @integer@, - "type": "MUGS", - "path": "@string@" - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} diff --git a/tests/Responses/product/create_with_long_translations_validation_fail_response.json b/tests/Responses/product/create_with_long_translations_validation_fail_response.json deleted file mode 100644 index a247c196eab..00000000000 --- a/tests/Responses/product/create_with_long_translations_validation_fail_response.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "enabled": {}, - "translations": { - "children": { - "en_US": { - "children": { - "name": { - "errors": [ - "Product name must not be longer than 255 characters." - ] - }, - "slug": { - "errors": [ - "Product slug must not be longer than 255 characters." - ] - }, - "description": {}, - "metaKeywords": {}, - "metaDescription": {}, - "shortDescription": {} - } - }, - "nl_NL": { - "children": { - "name": {}, - "slug": {}, - "description": {}, - "metaKeywords": {}, - "metaDescription": {}, - "shortDescription": {} - } - }, - "fr_FR": { - "children": { - "name": {}, - "slug": {}, - "description": {}, - "metaKeywords": {}, - "metaDescription": {}, - "shortDescription": {} - } - }, - "de_CH": { - "children": { - "name": {}, - "slug": {}, - "description": {}, - "metaKeywords": {}, - "metaDescription": {}, - "shortDescription": {} - } - } - } - }, - "attributes": {}, - "associations": {}, - "channels": {}, - "mainTaxon": {}, - "images": {}, - "code": {}, - "options": {}, - "productTaxons": {} - } - } -} diff --git a/tests/Responses/product/create_with_main_taxon_response.json b/tests/Responses/product/create_with_main_taxon_response.json deleted file mode 100644 index 5093e19b27f..00000000000 --- a/tests/Responses/product/create_with_main_taxon_response.json +++ /dev/null @@ -1,187 +0,0 @@ -{ - "id": @integer@, - "name": "Theme Mug", - "code": "MUG_TH", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Theme Mug", - "slug": "theme-mug" - } - }, - "productTaxons": [], - "channels": [], - "mainTaxon": { - "id": @integer@, - "code": "mugs", - "root": { - "id": @integer@, - "code": "category", - "children": { - "1": { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "2": { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "3": { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - }, - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "children": { - "1": { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "2": { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "3": { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - }, - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "reviews": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} diff --git a/tests/Responses/product/create_with_options_response.json b/tests/Responses/product/create_with_options_response.json deleted file mode 100644 index 87dc7d0baa4..00000000000 --- a/tests/Responses/product/create_with_options_response.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "id": @integer@, - "name": "Theme Mug", - "code": "MUG_TH", - "attributes": [], - "options": [ - { - "id": @integer@, - "code": "MUG_SIZE", - "position": 0, - "values": [ - { - "code": "MUG_SIZE_S", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Size S" - } - } - }, - { - "code": "MUG_SIZE_L", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Size L" - } - } - } - ], - "translations": {}, - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_SIZE" - } - } - }, - { - "id": @integer@, - "code": "MUG_COLOR", - "position": 1, - "values": [], - "translations": {}, - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_COLOR" - } - } - } - ], - "associations": [], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Theme Mug", - "slug": "theme-mug" - } - }, - "productTaxons": [], - "channels": [], - "reviews": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} diff --git a/tests/Responses/product/create_with_product_taxons_response.json b/tests/Responses/product/create_with_product_taxons_response.json deleted file mode 100644 index 23834f71264..00000000000 --- a/tests/Responses/product/create_with_product_taxons_response.json +++ /dev/null @@ -1,338 +0,0 @@ -{ - "id": @integer@, - "name": "Theme Mug", - "code": "MUG_TH", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Theme Mug", - "slug": "theme-mug" - } - }, - "productTaxons": [ - { - "id": @integer@, - "taxon": { - "id": @integer@, - "code": "category", - "children": [ - { - "id": @integer@, - "code": "mugs", - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "t-shirts", - "children": [ - { - "id": @integer@, - "code": "men", - "children": [], - "left": 9, - "right": 10, - "level": 2, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "women", - "children": [], - "left": 11, - "right": 12, - "level": 2, - "position": 1, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "position": 0 - }, - { - "id": @integer@, - "taxon": { - "id": @integer@, - "code": "mugs", - "root": { - "id": @integer@, - "code": "category", - "children": { - "1": { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "2": { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "3": { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - }, - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "children": { - "1": { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "2": { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "3": { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - }, - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "position": 0 - } - ], - "channels": [], - "reviews": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} diff --git a/tests/Responses/product/create_with_select_attribute_response.json b/tests/Responses/product/create_with_select_attribute_response.json deleted file mode 100644 index 0464bde5f6c..00000000000 --- a/tests/Responses/product/create_with_select_attribute_response.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "Theme Mug", - "id": @integer@, - "code": "MUG_TH", - "attributes": [ - { - "code": "mug_color", - "name": "Mug color", - "value": [ - "7a968ac4-a1e3-4a37-a707-f22a839130c4", - "ff62a939-d946-4d6b-b742-b7115875ae75" - ], - "type": "select", - "id": @integer@, - "localeCode": "en_US" - } - ], - "options": [], - "associations": [], - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Theme Mug", - "slug": "theme-mug" - } - }, - "productTaxons": [], - "channels": [], - "reviews": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_TH" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_TH\/variants\/" - } - } -} diff --git a/tests/Responses/product/index_response.json b/tests/Responses/product/index_response.json deleted file mode 100644 index 28657ef99a0..00000000000 --- a/tests/Responses/product/index_response.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 3, - "total": 22, - "_links": { - "self": { - "href": "\/api\/v1\/products\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/products\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/products\/?page=3&limit=10" - }, - "next": { - "href": "\/api\/v1\/products\/?page=2&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "name": "Breaking bad mug", - "code": "MUG_BB", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_BB" - } - } - }, - { - "id": @integer@, - "name": "Lotr mug", - "code": "MUG_LOTR", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_LOTR" - } - } - }, - { - "id": @integer@, - "name": "Star Wars mug", - "code": "MUG_SW", - "options": [], - "averageRating": 0, - "images": [ - { - "id": @integer@, - "type": "thumbnail", - "path": "\/uo\/product.jpg" - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW" - } - } - }, - { - "id": @integer@, - "name": "Product 10", - "code": "PRODUCT_10", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_10" - } - } - }, - { - "id": @integer@, - "name": "Product 11", - "code": "PRODUCT_11", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_11" - } - } - }, - { - "id": @integer@, - "name": "Product 12", - "code": "PRODUCT_12", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_12" - } - } - }, - { - "id": @integer@, - "name": "Product 13", - "code": "PRODUCT_13", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_13" - } - } - }, - { - "id": @integer@, - "name": "Product 14", - "code": "PRODUCT_14", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_14" - } - } - }, - { - "id": @integer@, - "name": "Product 15", - "code": "PRODUCT_15", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_15" - } - } - }, - { - "id": @integer@, - "name": "Product 16", - "code": "PRODUCT_16", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_16" - } - } - } - ] - } -} diff --git a/tests/Responses/product/paginated_index_response.json b/tests/Responses/product/paginated_index_response.json deleted file mode 100644 index 81d11f3cfee..00000000000 --- a/tests/Responses/product/paginated_index_response.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "page": 2, - "limit": 10, - "pages": 3, - "total": 22, - "_links": { - "self": { - "href": "\/api\/v1\/products\/?page=2&limit=10" - }, - "first": { - "href": "\/api\/v1\/products\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/products\/?page=3&limit=10" - }, - "next": { - "href": "\/api\/v1\/products\/?page=3&limit=10" - }, - "previous": { - "href": "\/api\/v1\/products\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "name": "Product 17", - "code": "PRODUCT_17", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_17" - } - } - }, - { - "id": @integer@, - "name": "Product 18", - "code": "PRODUCT_18", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_18" - } - } - }, - { - "id": @integer@, - "name": "Product 19", - "code": "PRODUCT_19", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_19" - } - } - }, - { - "id": @integer@, - "name": "Product 20", - "code": "PRODUCT_20", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_20" - } - } - }, - { - "id": @integer@, - "name": "Product 21", - "code": "PRODUCT_21", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_21" - } - } - }, - { - "id": @integer@, - "name": "Product 22", - "code": "PRODUCT_22", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_22" - } - } - }, - { - "id": @integer@, - "name": "Product 4", - "code": "PRODUCT_4", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_4" - } - } - }, - { - "id": @integer@, - "name": "Product 5", - "code": "PRODUCT_5", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_5" - } - } - }, - { - "id": @integer@, - "name": "Product 6", - "code": "PRODUCT_6", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_6" - } - } - }, - { - "id": @integer@, - "name": "Product 7", - "code": "PRODUCT_7", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_7" - } - } - } - ] - } -} diff --git a/tests/Responses/product/show_response.json b/tests/Responses/product/show_response.json deleted file mode 100644 index bec5bbdbea6..00000000000 --- a/tests/Responses/product/show_response.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "id": @integer@, - "name": "Star Wars mug", - "code": "MUG_SW", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Star Wars mug", - "slug": "star-wars-mug", - "description": "@string@" - }, - "nl_NL": { - "id": @integer@, - "locale": "nl_NL", - "name": "Mok van het thema", - "slug": "mok-van-het-thema", - "description": "@string@" - } - }, - "productTaxons": [], - "channels": [], - "reviews": [], - "averageRating": 0, - "images": [ - { - "id": @integer@, - "type": "thumbnail", - "path": "\/uo\/product.jpg" - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/" - } - } -} diff --git a/tests/Responses/product/sorted_index_response.json b/tests/Responses/product/sorted_index_response.json deleted file mode 100644 index 2a6b0cf34ba..00000000000 --- a/tests/Responses/product/sorted_index_response.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 3, - "total": 22, - "_links": { - "self": { - "href": "\/api\/v1\/products\/?sorting%5Bcode%5D=asc&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/products\/?sorting%5Bcode%5D=asc&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/products\/?sorting%5Bcode%5D=asc&page=3&limit=10" - }, - "next": { - "href": "\/api\/v1\/products\/?sorting%5Bcode%5D=asc&page=2&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "name": "Breaking bad mug", - "code": "MUG_BB", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_BB" - } - } - }, - { - "id": @integer@, - "name": "Lotr mug", - "code": "MUG_LOTR", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_LOTR" - } - } - }, - { - "id": @integer@, - "name": "Star Wars mug", - "code": "MUG_SW", - "options": [], - "averageRating": 0, - "images": [ - { - "id": @integer@, - "type": "thumbnail", - "path": "\/uo\/product.jpg" - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW" - } - } - }, - { - "id": @integer@, - "name": "Product 10", - "code": "PRODUCT_10", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_10" - } - } - }, - { - "id": @integer@, - "name": "Product 11", - "code": "PRODUCT_11", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_11" - } - } - }, - { - "id": @integer@, - "name": "Product 12", - "code": "PRODUCT_12", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_12" - } - } - }, - { - "id": @integer@, - "name": "Product 13", - "code": "PRODUCT_13", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_13" - } - } - }, - { - "id": @integer@, - "name": "Product 14", - "code": "PRODUCT_14", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_14" - } - } - }, - { - "id": @integer@, - "name": "Product 15", - "code": "PRODUCT_15", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_15" - } - } - }, - { - "id": @integer@, - "name": "Product 16", - "code": "PRODUCT_16", - "options": [], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/PRODUCT_16" - } - } - } - ] - } -} diff --git a/tests/Responses/product_association_type/create_response.json b/tests/Responses/product_association_type/create_response.json deleted file mode 100644 index b7974e9c15c..00000000000 --- a/tests/Responses/product_association_type/create_response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": @integer@, - "code": "cross_sell", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Cross sell" - } - }, - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_association_type/create_validation_fail_response.json b/tests/Responses/product_association_type/create_validation_fail_response.json deleted file mode 100644 index 2151b96eb47..00000000000 --- a/tests/Responses/product_association_type/create_validation_fail_response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "translations": {}, - "code": { - "errors": [ - "Please enter association type code." - ] - } - } - } -} diff --git a/tests/Responses/product_association_type/index_response.json b/tests/Responses/product_association_type/index_response.json deleted file mode 100644 index ba7d46abbc1..00000000000 --- a/tests/Responses/product_association_type/index_response.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 2, - "_links": { - "self": { - "href": "\/api\/v1\/product-association-types\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/product-association-types\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/product-association-types\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "cross_sell", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Cross sell" - }, - "nl_NL": { - "id": @integer@, - "locale": "nl_NL", - "name": "Cross sell (nl_NL)" - } - }, - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "up_sell", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Up sell" - }, - "nl_NL": { - "id": @integer@, - "locale": "nl_NL", - "name": "Up sell (nl_NL)" - } - }, - "_links": { - "self": { - "href": "@string@" - } - } - } - ] - } -} diff --git a/tests/Responses/product_association_type/show_response.json b/tests/Responses/product_association_type/show_response.json deleted file mode 100644 index 719d422fec9..00000000000 --- a/tests/Responses/product_association_type/show_response.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "id": @integer@, - "code": "cross_sell", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Cross sell" - }, - "nl_NL": { - "id": @integer@, - "locale": "nl_NL", - "name": "Cross sell (nl_NL)" - } - }, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/product-association-types\/cross_sell" - } - } -} diff --git a/tests/Responses/product_association_type/update_response.json b/tests/Responses/product_association_type/update_response.json deleted file mode 100644 index c260495e771..00000000000 --- a/tests/Responses/product_association_type/update_response.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "id": @integer@, - "code": "cross_sell", - "name": "Cross sell (old)", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_association_type/update_validation_fail_response.json b/tests/Responses/product_association_type/update_validation_fail_response.json deleted file mode 100644 index c1a6be2e41e..00000000000 --- a/tests/Responses/product_association_type/update_validation_fail_response.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "translations": { - "children": { - "en_US": { - "children": { - "name": { - "errors": [ - "Please enter association type name." - ] - } - } - }, - "nl_NL": { - "children": { - "name": { - "errors": [ - "Please enter association type name." - ] - } - } - }, - "fr_FR": { - "children": { - "name": {} - } - }, - "de_CH": { - "children": { - "name": {} - } - } - } - }, - "code": {} - } - } -} diff --git a/tests/Responses/product_attribute/create_response.json b/tests/Responses/product_attribute/create_response.json deleted file mode 100644 index ab7283f4100..00000000000 --- a/tests/Responses/product_attribute/create_response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "id": @integer@, - "code": "mug_material", - "type": "text", - "position": 0, - "configuration": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "translations": { - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "name": "Becher Material" - }, - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug material" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_material" - } - } -} diff --git a/tests/Responses/product_attribute/create_select_response.json b/tests/Responses/product_attribute/create_select_response.json deleted file mode 100644 index 844401445b3..00000000000 --- a/tests/Responses/product_attribute/create_select_response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": @integer@, - "code": "mug_color", - "type": "select", - "configuration": { - "choices": @array@, - "multiple": true, - "min": 1, - "max": 2 - }, - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug color" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "name": "Becher Farbe" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_color" - } - } -} diff --git a/tests/Responses/product_attribute/create_validation_fail_response.json b/tests/Responses/product_attribute/create_validation_fail_response.json deleted file mode 100644 index da43bb2cf34..00000000000 --- a/tests/Responses/product_attribute/create_validation_fail_response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "type": {}, - "position": {}, - "translations": {}, - "code": { - "errors": [ - "Please enter attribute code." - ] - }, - "configuration": { - "children": { - "min": {}, - "max": {} - } - } - } - } -} diff --git a/tests/Responses/product_attribute/index_response.json b/tests/Responses/product_attribute/index_response.json deleted file mode 100644 index 12575f5b679..00000000000 --- a/tests/Responses/product_attribute/index_response.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 3, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/product-attributes\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/product-attributes\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "mug_material", - "type": "text", - "position": 0, - "translations": { - "de": { - "id": @integer@, - "locale": "de", - "name": "Becher Sammlung" - }, - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug collection" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_material" - } - } - }, - { - "id": @integer@, - "code": "mug_collection", - "type": "text", - "position": 1, - "translations": { - "de": { - "id": @integer@, - "locale": "de", - "name": "Becher Material" - }, - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug material" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_collection" - } - } - }, - { - "id": @integer@, - "code": "mug_color", - "type": "select", - "position": 2, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug color" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_color" - } - } - } - ] - } -} diff --git a/tests/Responses/product_attribute/index_response_after_delete.json b/tests/Responses/product_attribute/index_response_after_delete.json deleted file mode 100644 index ad909039eb9..00000000000 --- a/tests/Responses/product_attribute/index_response_after_delete.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 2, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/product-attributes\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/product-attributes\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "mug_collection", - "type": "text", - "position": 0, - "translations": { - "de": { - "id": @integer@, - "locale": "de", - "name": "Becher Material" - }, - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug material" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_collection" - } - } - }, - { - "id": @integer@, - "code": "mug_color", - "type": "select", - "position": 1, - "translations": { - "en_US": { - "locale": "en_US", - "id": @integer@, - "name": "Mug color" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_color" - } - } - } - ] - } -} diff --git a/tests/Responses/product_attribute/show_response.json b/tests/Responses/product_attribute/show_response.json deleted file mode 100644 index 8cb3ddcaf2f..00000000000 --- a/tests/Responses/product_attribute/show_response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "id": @integer@, - "code": "mug_material", - "type": "text", - "configuration": [], - "position": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "translations": { - "de": { - "id": @integer@, - "locale": "de", - "name": "Becher Sammlung" - }, - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug collection" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_material" - } - } -} diff --git a/tests/Responses/product_attribute/show_response_after_partial_update.json b/tests/Responses/product_attribute/show_response_after_partial_update.json deleted file mode 100644 index 19480280728..00000000000 --- a/tests/Responses/product_attribute/show_response_after_partial_update.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": @integer@, - "code": "mug_material", - "type": "text", - "position": 0, - "configuration": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "translations": { - "de": { - "id": @integer@, - "locale": "de", - "name": "Becher Sammlung" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "name": "Becher Material" - }, - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug material" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_material" - } - } -} diff --git a/tests/Responses/product_attribute/show_response_after_update.json b/tests/Responses/product_attribute/show_response_after_update.json deleted file mode 100644 index b46724b6850..00000000000 --- a/tests/Responses/product_attribute/show_response_after_update.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": @integer@, - "code": "mug_material", - "type": "text", - "position": 2, - "configuration": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "translations": { - "de": { - "id": @integer@, - "locale": "de", - "name": "Becher Sammlung" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "name": "Becher Material" - }, - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug material" - } - }, - "_links": { - "self": { - "href": "\/api\/v1\/product-attributes\/mug_material" - } - } -} diff --git a/tests/Responses/product_option/create_response.json b/tests/Responses/product_option/create_response.json deleted file mode 100644 index 4c4c80d5d6a..00000000000 --- a/tests/Responses/product_option/create_response.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "id": @integer@, - "code": "MUG_SIZE", - "position": 0, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug size" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "name": "Bechergröße" - } - }, - "values": [ - { - "code": "MUG_SIZE_S", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Small" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "value": "Klein" - } - } - }, - { - "code": "MUG_SIZE_L", - "translations": { - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "value": "Groß" - }, - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Large" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_SIZE" - } - } -} diff --git a/tests/Responses/product_option/create_validation_fail_response.json b/tests/Responses/product_option/create_validation_fail_response.json deleted file mode 100644 index 4ef34a42939..00000000000 --- a/tests/Responses/product_option/create_validation_fail_response.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "position": {}, - "translations": {}, - "values": {}, - "code": { - "errors": [ - "Please enter option code." - ] - } - } - } -} diff --git a/tests/Responses/product_option/index_response.json b/tests/Responses/product_option/index_response.json deleted file mode 100644 index 854eef6a2d8..00000000000 --- a/tests/Responses/product_option/index_response.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 2, - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/product-options\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/product-options\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "MUG_SIZE", - "position": 0, - "translations": {}, - "values": [ - { - "code": "MUG_SIZE_S", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Size S" - } - } - }, - { - "code": "MUG_SIZE_L", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Size L" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_SIZE" - } - } - }, - { - "id": @integer@, - "code": "MUG_COLOR", - "position": 1, - "translations": {}, - "values": [], - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_COLOR" - } - } - } - ] - } -} diff --git a/tests/Responses/product_option/index_response_after_delete.json b/tests/Responses/product_option/index_response_after_delete.json deleted file mode 100644 index 9c3fa89e193..00000000000 --- a/tests/Responses/product_option/index_response_after_delete.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 1, - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/product-options\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/product-options\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "MUG_COLOR", - "position": 0, - "translations": {}, - "values": [], - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_COLOR" - } - } - } - ] - } -} diff --git a/tests/Responses/product_option/show_response.json b/tests/Responses/product_option/show_response.json deleted file mode 100644 index 5d820654b3e..00000000000 --- a/tests/Responses/product_option/show_response.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": @integer@, - "code": "MUG_SIZE", - "position": 0, - "translations": {}, - "values": [ - { - "code": "MUG_SIZE_S", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Size S" - } - } - }, - { - "code": "MUG_SIZE_L", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Size L" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_SIZE" - } - } -} diff --git a/tests/Responses/product_option/show_response_after_partial_update.json b/tests/Responses/product_option/show_response_after_partial_update.json deleted file mode 100644 index c579f511039..00000000000 --- a/tests/Responses/product_option/show_response_after_partial_update.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "id": @integer@, - "code": "MUG_SIZE", - "position": 0, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug size" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "name": "Bechergröße" - } - }, - "values": [ - { - "code": "MUG_SIZE_S", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Small" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "value": "Klein" - } - } - }, - { - "code": "MUG_SIZE_L", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Large" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "value": "Groß" - } - } - }, - { - "code": "MUG_SIZE_M", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Medium" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "value": "Mittel" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_SIZE" - } - } -} diff --git a/tests/Responses/product_option/show_response_after_update.json b/tests/Responses/product_option/show_response_after_update.json deleted file mode 100644 index 5998ea8d2a8..00000000000 --- a/tests/Responses/product_option/show_response_after_update.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "id": @integer@, - "code": "MUG_SIZE", - "position": 1, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug size" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "name": "Bechergröße" - } - }, - "values": [ - { - "code": "MUG_SIZE_S", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Small" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "value": "Klein" - } - } - }, - { - "code": "MUG_SIZE_L", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Large" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "value": "Groß" - } - } - }, - { - "code": "MUG_SIZE_M", - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "value": "Medium" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "value": "Mittel" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/product-options\/MUG_SIZE" - } - } -} diff --git a/tests/Responses/product_review/accept_response.json b/tests/Responses/product_review/accept_response.json deleted file mode 100644 index 915e2eb4fd3..00000000000 --- a/tests/Responses/product_review/accept_response.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "id": @integer@, - "title": "mug_review_best", - "rating": 4, - "comment": "mug_review_best_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "accepted", - "reviewSubject": { - "id": @integer@, - "code": "MUG_REVIEW_BEST", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en": { - "locale": "en" - } - }, - "productTaxons": [], - "channels": [], - "reviews": { - "1": { - "id": @integer@, - "title": "mug_review_good", - "rating": 3, - "comment": "mug_review_good_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "new", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - }, - "2": { - "id": @integer@, - "title": "mug_review_bad", - "rating": 1, - "comment": "mug_review_bad_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "rejected", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - } - }, - "averageRating": 4, - "images": [], - "_links": { - "self": { - "href": "/api/v1/products/MUG_REVIEW_BEST" - }, - "variants": { - "href": "/api/v1/products/MUG_REVIEW_BEST/variants/" - } - } - }, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" -} diff --git a/tests/Responses/product_review/change_status_fail_response.json b/tests/Responses/product_review/change_status_fail_response.json deleted file mode 100644 index bc4332eb237..00000000000 --- a/tests/Responses/product_review/change_status_fail_response.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code":400, - "message":"" -} diff --git a/tests/Responses/product_review/create_response.json b/tests/Responses/product_review/create_response.json deleted file mode 100644 index 2e950d5efdf..00000000000 --- a/tests/Responses/product_review/create_response.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "id": @integer@, - "title": "A good product", - "rating": 3, - "comment": "This is a good product.", - "author": { - "id": @integer@, - "email": "my_review@example.com", - "emailCanonical": "my_review@example.com", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "new", - "reviewSubject": { - "id": @integer@, - "code": "MUG_REVIEW_BEST", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en": { - "locale": "en" - } - }, - "productTaxons": [], - "channels": [], - "reviews": [ - { - "id": @integer@, - "title": "mug_review_best", - "rating": 4, - "comment": "mug_review_best_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "new", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - }, - { - "id": @integer@, - "title": "mug_review_good", - "rating": 3, - "comment": "mug_review_good_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "new", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - }, - { - "id": @integer@, - "title": "mug_review_bad", - "rating": 1, - "comment": "mug_review_bad_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "rejected", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - } - ], - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_REVIEW_BEST" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_REVIEW_BEST\/variants\/" - } - } - }, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" -} diff --git a/tests/Responses/product_review/create_validation_fail_response.json b/tests/Responses/product_review/create_validation_fail_response.json deleted file mode 100644 index d35dab9c82b..00000000000 --- a/tests/Responses/product_review/create_validation_fail_response.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "rating": { - "errors": [ - "You must check review rating." - ], - "children": [ - {}, - {}, - {}, - {}, - {} - ] - }, - "title": { - "errors": [ - "Review title should not be blank." - ] - }, - "comment": { - "errors": [ - "Review comment should not be blank." - ] - }, - "author": { - "children": { - "email": { - "errors": [ - "Please enter your email." - ] - } - } - } - } - } -} diff --git a/tests/Responses/product_review/index_response.json b/tests/Responses/product_review/index_response.json deleted file mode 100644 index afa682d4ea2..00000000000 --- a/tests/Responses/product_review/index_response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 0, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_REVIEW_BEST\/reviews\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/products\/MUG_REVIEW_BEST\/reviews\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/products\/MUG_REVIEW_BEST\/reviews\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [] - } -} diff --git a/tests/Responses/product_review/reject_response.json b/tests/Responses/product_review/reject_response.json deleted file mode 100644 index 37b66551213..00000000000 --- a/tests/Responses/product_review/reject_response.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "id": @integer@, - "title": "mug_review_best", - "rating": 4, - "comment": "mug_review_best_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "rejected", - "reviewSubject": { - "id": @integer@, - "code": "MUG_REVIEW_BEST", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en": { - "locale": "en" - } - }, - "productTaxons": [], - "channels": [], - "reviews": { - "1": { - "id": @integer@, - "title": "mug_review_good", - "rating": 3, - "comment": "mug_review_good_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "new", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - }, - "2": { - "id": @integer@, - "title": "mug_review_bad", - "rating": 1, - "comment": "mug_review_bad_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "rejected", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - } - }, - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "/api/v1/products/MUG_REVIEW_BEST" - }, - "variants": { - "href": "/api/v1/products/MUG_REVIEW_BEST/variants/" - } - } - }, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" -} diff --git a/tests/Responses/product_review/show_response.json b/tests/Responses/product_review/show_response.json deleted file mode 100644 index 486d9674bda..00000000000 --- a/tests/Responses/product_review/show_response.json +++ /dev/null @@ -1,92 +0,0 @@ -{ - "id": @integer@, - "title": "mug_review_best", - "rating": 4, - "comment": "mug_review_best_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "new", - "reviewSubject": { - "id": @integer@, - "code": "MUG_REVIEW_BEST", - "attributes": [], - "options": [], - "associations": [], - "translations": { - "en": { - "locale": "en" - } - }, - "productTaxons": [], - "channels": [], - "reviews": { - "1": { - "id": @integer@, - "title": "mug_review_good", - "rating": 3, - "comment": "mug_review_good_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "new", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - }, - "2": { - "id": @integer@, - "title": "mug_review_bad", - "rating": 1, - "comment": "mug_review_bad_comment", - "author": { - "id": @integer@, - "email": "example.queen@example.com", - "emailCanonical": "example.queen@example.com", - "firstName": "Example", - "lastName": "Queen", - "gender": "u", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "status": "rejected", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" - } - }, - "averageRating": 0, - "images": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_REVIEW_BEST" - }, - "variants": { - "href": "\/api\/v1\/products\/MUG_REVIEW_BEST\/variants\/" - } - } - }, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()" -} diff --git a/tests/Responses/product_variant/create_response.json b/tests/Responses/product_variant/create_response.json deleted file mode 100644 index 9fc965eef88..00000000000 --- a/tests/Responses/product_variant/create_response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "id": @integer@, - "code": "MONSTER_MUG", - "optionValues": [], - "position": 23, - "translations": [], - "onHold": 0, - "onHand": 0, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "@string@" - }, - "product": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_variant/create_tracked_response.json b/tests/Responses/product_variant/create_tracked_response.json deleted file mode 100644 index 25e62599960..00000000000 --- a/tests/Responses/product_variant/create_tracked_response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "id": @integer@, - "code": "MONSTER_MUG", - "optionValues": [], - "position": 23, - "translations": [], - "onHold": 0, - "onHand": 5, - "version": 1, - "tracked": true, - "channelPricings": [], - "_links": { - "self": { - "href": "@string@" - }, - "product": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_variant/create_validation_fail_response.json b/tests/Responses/product_variant/create_validation_fail_response.json deleted file mode 100644 index b409f148d5d..00000000000 --- a/tests/Responses/product_variant/create_validation_fail_response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "enabled": {}, - "translations": {}, - "version": {}, - "tracked": {}, - "width": {}, - "height": {}, - "depth": {}, - "weight": {}, - "taxCategory": {}, - "shippingRequired": {}, - "shippingCategory": {}, - "channelPricings": {}, - "code": { - "errors": [ - "Please enter the code." - ] - }, - "optionValues": { - "children": { - "MUG_TYPE": {} - } - } - } - } -} diff --git a/tests/Responses/product_variant/create_with_channel_pricings_response.json b/tests/Responses/product_variant/create_with_channel_pricings_response.json deleted file mode 100644 index 33f4da46fee..00000000000 --- a/tests/Responses/product_variant/create_with_channel_pricings_response.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "id": @integer@, - "code": "MONSTER_MUG", - "optionValues": [], - "position": 23, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US" - } - }, - "onHold": 0, - "onHand": 0, - "version": 1, - "tracked": false, - "channelPricings": { - "WEB": { - "channelCode": "WEB", - "price": 124300 - }, - "MOB": { - "channelCode": "MOB", - "price": 34200 - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "product": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_variant/create_with_product_option_response.json b/tests/Responses/product_variant/create_with_product_option_response.json deleted file mode 100644 index 3ca44ee3546..00000000000 --- a/tests/Responses/product_variant/create_with_product_option_response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": @integer@, - "code": "MONSTER_MUG", - "optionValues": [ - { - "code": "MUG_TYPE_MEDIUM", - "translations": [] - } - ], - "position": 23, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US" - } - }, - "onHold": 0, - "onHand": 0, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MONSTER_MUG" - }, - "product": { - "href": "\/api\/v1\/products\/MUG_SW" - } - } -} diff --git a/tests/Responses/product_variant/create_with_shipping_category_response.json b/tests/Responses/product_variant/create_with_shipping_category_response.json deleted file mode 100644 index 7cc29ae829c..00000000000 --- a/tests/Responses/product_variant/create_with_shipping_category_response.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": @integer@, - "code": "MONSTER_MUG", - "optionValues": [], - "position": 23, - "translations": [], - "onHold": 0, - "onHand": 0, - "version": 1, - "tracked": false, - "shippingCategory": { - "id": @integer@, - "code": "SC1", - "name": "Shipping Category 1", - "description": "@string@", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channelPricings": [], - "_links": { - "self": { - "href": "@string@" - }, - "product": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_variant/create_with_tax_category_response.json b/tests/Responses/product_variant/create_with_tax_category_response.json deleted file mode 100644 index 6e1d9ff826f..00000000000 --- a/tests/Responses/product_variant/create_with_tax_category_response.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "id": @integer@, - "code": "MONSTER_MUG", - "optionValues": [], - "position": 23, - "translations": [], - "onHold": 0, - "onHand": 0, - "version": 1, - "tracked": false, - "taxCategory": { - "id": @integer@, - "code": "TC1", - "name": "Tax Category 1", - "description": "@string@", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } - }, - "channelPricings": [], - "_links": { - "self": { - "href": "@string@" - }, - "product": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_variant/create_with_translations_response.json b/tests/Responses/product_variant/create_with_translations_response.json deleted file mode 100644 index c058fe64f8f..00000000000 --- a/tests/Responses/product_variant/create_with_translations_response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": @integer@, - "code": "MONSTER_MUG", - "optionValues": [], - "position": 23, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Monster Mug" - }, - "de_CH": { - "id": @integer@, - "locale": "de_CH", - "name": "Monsterbecher" - } - }, - "onHold": 0, - "onHand": 0, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "@string@" - }, - "product": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_variant/index_response.json b/tests/Responses/product_variant/index_response.json deleted file mode 100644 index 4797b9e15eb..00000000000 --- a/tests/Responses/product_variant/index_response.json +++ /dev/null @@ -1,234 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 3, - "total": 21, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=3&limit=10" - }, - "next": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=2&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "MUG_1", - "optionValues": [], - "position": 1, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 1" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_1" - } - } - }, - { - "id": @integer@, - "code": "MUG_2", - "optionValues": [], - "position": 2, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 2" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_2" - } - } - }, - { - "id": @integer@, - "code": "MUG_3", - "optionValues": [], - "position": 3, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 3" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_3" - } - } - }, - { - "id": @integer@, - "code": "MUG_4", - "optionValues": [], - "position": 4, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 4" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_4" - } - } - }, - { - "id": @integer@, - "code": "MUG_5", - "optionValues": [], - "position": 5, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 5" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_5" - } - } - }, - { - "id": @integer@, - "code": "MUG_6", - "optionValues": [], - "position": 6, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 6" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_6" - } - } - }, - { - "id": @integer@, - "code": "MUG_7", - "optionValues": [], - "position": 7, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 7" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_7" - } - } - }, - { - "id": @integer@, - "code": "MUG_8", - "optionValues": [], - "position": 8, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 8" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_8" - } - } - }, - { - "id": @integer@, - "code": "MUG_9", - "optionValues": [], - "position": 9, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 9" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_9" - } - } - }, - { - "id": @integer@, - "code": "MUG_10", - "optionValues": [], - "position": 10, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 10" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_10" - } - } - } - ] - } -} diff --git a/tests/Responses/product_variant/not_changed_on_hand_response.json b/tests/Responses/product_variant/not_changed_on_hand_response.json deleted file mode 100644 index 008e812c940..00000000000 --- a/tests/Responses/product_variant/not_changed_on_hand_response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "id":@integer@, - "code":"SMALL_STICKER", - "optionValues":[], - "position":0, - "translations": { - "en_US": { - "id": @integer@, - "locale":"en_US", - "name":"Small sticker" - } - }, - "version": 2, - "onHold":0, - "onHand":8, - "tracked":false, - "channelPricings":[], - "_links":{ - "self":{ - "href": "@string@" - }, - "product": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_variant/paginated_index_response.json b/tests/Responses/product_variant/paginated_index_response.json deleted file mode 100644 index 0d1ad2055f0..00000000000 --- a/tests/Responses/product_variant/paginated_index_response.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "page": 2, - "limit": 10, - "pages": 3, - "total": 21, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=2&limit=10" - }, - "first": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=3&limit=10" - }, - "next": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=3&limit=10" - }, - "previous": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "MUG_11", - "optionValues": [], - "position": 11, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 11" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_11" - } - } - }, - { - "id": @integer@, - "code": "MUG_12", - "optionValues": [], - "position": 12, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 12" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_12" - } - } - }, - { - "id": @integer@, - "code": "MUG_13", - "optionValues": [], - "position": 13, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 13" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_13" - } - } - }, - { - "id": @integer@, - "code": "MUG_14", - "optionValues": [], - "position": 14, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 14" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_14" - } - } - }, - { - "id": @integer@, - "code": "MUG_15", - "optionValues": [], - "position": 15, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 15" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_15" - } - } - }, - { - "id": @integer@, - "code": "MUG_16", - "optionValues": [], - "position": 16, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 16" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_16" - } - } - }, - { - "id": @integer@, - "code": "MUG_17", - "optionValues": [], - "position": 17, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 17" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_17" - } - } - }, - { - "id": @integer@, - "code": "MUG_18", - "optionValues": [], - "position": 18, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 18" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_18" - } - } - }, - { - "id": @integer@, - "code": "MUG_19", - "optionValues": [], - "position": 19, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 19" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_19" - } - } - }, - { - "id": @integer@, - "code": "MUG_20", - "optionValues": [], - "position": 20, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 20" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_20" - } - } - } - ] - } -} diff --git a/tests/Responses/product_variant/show_response.json b/tests/Responses/product_variant/show_response.json deleted file mode 100644 index 00c9f0634a3..00000000000 --- a/tests/Responses/product_variant/show_response.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "id": @integer@, - "code": "MUG_2", - "optionValues": [], - "position": 2, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 2" - } - }, - "version": 1, - "onHold": 0, - "onHand": 0, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "@string@" - }, - "product": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/product_variant/sorted_index_response.json b/tests/Responses/product_variant/sorted_index_response.json deleted file mode 100644 index 472d81c0156..00000000000 --- a/tests/Responses/product_variant/sorted_index_response.json +++ /dev/null @@ -1,239 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 3, - "total": 21, - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?sorting%5Bposition%5D=desc&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?sorting%5Bposition%5D=desc&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?sorting%5Bposition%5D=desc&page=3&limit=10" - }, - "next": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/?sorting%5Bposition%5D=desc&page=2&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "LARGE_MUG", - "optionValues": [ - { - "code": "MUG_TYPE_LARGE", - "translations": [] - } - ], - "position": 22, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Large Mug" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/LARGE_MUG" - } - } - }, - { - "id": @integer@, - "code": "MUG_20", - "optionValues": [], - "position": 20, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 20" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_20" - } - } - }, - { - "id": @integer@, - "code": "MUG_19", - "optionValues": [], - "position": 19, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 19" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_19" - } - } - }, - { - "id": @integer@, - "code": "MUG_18", - "optionValues": [], - "position": 18, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 18" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_18" - } - } - }, - { - "id": @integer@, - "code": "MUG_17", - "optionValues": [], - "position": 17, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 17" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_17" - } - } - }, - { - "id": @integer@, - "code": "MUG_16", - "optionValues": [], - "position": 16, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 16" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_16" - } - } - }, - { - "id": @integer@, - "code": "MUG_15", - "optionValues": [], - "position": 15, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 15" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_15" - } - } - }, - { - "id": @integer@, - "code": "MUG_14", - "optionValues": [], - "position": 14, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 14" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_14" - } - } - }, - { - "id": @integer@, - "code": "MUG_13", - "optionValues": [], - "position": 13, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 13" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_13" - } - } - }, - { - "id": @integer@, - "code": "MUG_12", - "optionValues": [], - "position": 12, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Mug 12" - } - }, - "version": 1, - "tracked": false, - "channelPricings": [], - "_links": { - "self": { - "href": "\/api\/v1\/products\/MUG_SW\/variants\/MUG_12" - } - } - } - ] - } -} diff --git a/tests/Responses/promotion/create_coupon_based_response.json b/tests/Responses/promotion/create_coupon_based_response.json deleted file mode 100644 index ebfd057126f..00000000000 --- a/tests/Responses/promotion/create_coupon_based_response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": @integer@, - "code": "christmas-promotion", - "name": "Christmas Promotion", - "priority": 0, - "exclusive": false, - "used": 0, - "couponBased": true, - "rules": [], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/christmas-promotion" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/christmas-promotion\/coupons\/" - } - } -} diff --git a/tests/Responses/promotion/create_exclusive_response.json b/tests/Responses/promotion/create_exclusive_response.json deleted file mode 100644 index 0fe9cb39d70..00000000000 --- a/tests/Responses/promotion/create_exclusive_response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": @integer@, - "code": "christmas-promotion", - "name": "Christmas Promotion", - "priority": 0, - "exclusive": true, - "used": 0, - "couponBased": false, - "rules": [], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/christmas-promotion" - } - } -} diff --git a/tests/Responses/promotion/create_response.json b/tests/Responses/promotion/create_response.json deleted file mode 100644 index 5f7d7b504ab..00000000000 --- a/tests/Responses/promotion/create_response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": @integer@, - "code": "christmas-promotion", - "name": "Christmas Promotion", - "priority": 0, - "exclusive": false, - "used": 0, - "couponBased": false, - "rules": [], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/christmas-promotion" - } - } -} diff --git a/tests/Responses/promotion/create_response_with_actions.json b/tests/Responses/promotion/create_response_with_actions.json deleted file mode 100644 index 0eabc5ac6e7..00000000000 --- a/tests/Responses/promotion/create_response_with_actions.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "id": @integer@, - "code": "christmas-promotion", - "name": "Christmas Promotion", - "priority": 0, - "exclusive": false, - "used": 0, - "couponBased": false, - "rules": [], - "actions": [ - { - "id": @integer@, - "type": "unit_percentage_discount", - "configuration": { - "WEB": { - "percentage": 0.15, - "filters": { - "price_range_filter": { - "min": 100, - "max": 1200000 - }, - "taxons_filter": { - "taxons": [ - "mugs" - ] - }, - "products_filter": { - "products": [ - "MUG_SW", - "MUG_LOTR" - ] - } - } - }, - "MOB": { - "percentage": 0.2, - "filters": { - "price_range_filter": [], - "taxons_filter": { - "taxons": [] - }, - "products_filter": { - "products": [ - "MUG_SW" - ] - } - } - } - } - }, - { - "id": @integer@, - "type": "order_fixed_discount", - "configuration": { - "WEB": { - "amount": 1200 - }, - "MOB": { - "amount": 1500 - } - } - } - ], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/christmas-promotion" - } - } -} diff --git a/tests/Responses/promotion/create_response_with_channels.json b/tests/Responses/promotion/create_response_with_channels.json deleted file mode 100644 index d50516a82d1..00000000000 --- a/tests/Responses/promotion/create_response_with_channels.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "id": @integer@, - "code": "christmas-promotion", - "name": "Christmas Promotion", - "priority": 0, - "exclusive": false, - "used": 0, - "couponBased": false, - "rules": [], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [ - { - "id": @integer@, - "code": "WEB", - "name": "Web Channel", - "description": "Lorem ipsum", - "hostname": "localhost", - "color": "black", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/WEB" - } - } - }, - { - "id": @integer@, - "code": "MOB", - "name": "Mobile Channel", - "description": "Lorem ipsum psore", - "hostname": "localhost", - "color": "yellow", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "enabled": true, - "taxCalculationStrategy": "order_items_based", - "_links": { - "self": { - "href": "\/api\/v1\/channels\/MOB" - } - } - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/christmas-promotion" - } - } -} diff --git a/tests/Responses/promotion/create_response_with_rules.json b/tests/Responses/promotion/create_response_with_rules.json deleted file mode 100644 index 3b5127bebac..00000000000 --- a/tests/Responses/promotion/create_response_with_rules.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": @integer@, - "code": "christmas-promotion", - "name": "Christmas Promotion", - "priority": 0, - "exclusive": false, - "used": 0, - "couponBased": false, - "rules": [ - { - "id": @integer@, - "type": "nth_order", - "configuration": { - "nth": 3 - } - }, - { - "id": @integer@, - "type": "item_total", - "configuration": { - "WEB": { - "amount": 1200 - }, - "MOB": { - "amount": 1500 - } - } - } - ], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/christmas-promotion" - } - } -} diff --git a/tests/Responses/promotion/create_response_with_time_of_duration.json b/tests/Responses/promotion/create_response_with_time_of_duration.json deleted file mode 100644 index a5a643ed8a0..00000000000 --- a/tests/Responses/promotion/create_response_with_time_of_duration.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": @integer@, - "code": "christmas-promotion", - "name": "Christmas Promotion", - "priority": 0, - "exclusive": false, - "used": 0, - "startsAt": "@string@.isDateTime()", - "endsAt": "@string@.isDateTime()", - "couponBased": false, - "rules": [], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/christmas-promotion" - } - } -} diff --git a/tests/Responses/promotion/create_validation_fail_response.json b/tests/Responses/promotion/create_validation_fail_response.json deleted file mode 100644 index 617db084535..00000000000 --- a/tests/Responses/promotion/create_validation_fail_response.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "name": { - "errors": [ - "Please enter promotion name." - ] - }, - "description": {}, - "exclusive": {}, - "usageLimit": {}, - "startsAt": { - "children": { - "date": {}, - "time": {} - } - }, - "endsAt": { - "children": { - "date": {}, - "time": {} - } - }, - "priority": {}, - "couponBased": {}, - "rules": {}, - "actions": {}, - "channels": {}, - "code": { - "errors": [ - "Please enter promotion code." - ] - } - } - } -} diff --git a/tests/Responses/promotion/filtered_by_code_and_name_index_response.json b/tests/Responses/promotion/filtered_by_code_and_name_index_response.json deleted file mode 100644 index 88ad874afba..00000000000 --- a/tests/Responses/promotion/filtered_by_code_and_name_index_response.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 5, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/?criteria%5Bsearch%5D=promo&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/promotions\/?criteria%5Bsearch%5D=promo&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/promotions\/?criteria%5Bsearch%5D=promo&page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "AUTUMNAL_PROMO", - "name": "Autumnal special", - "priority": 7, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "WEEKEND_PROMO", - "name": "Weekend special", - "priority": 6, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Sunday", - "name": "Sunday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Sunday" - } - } - }, - { - "id": @integer@, - "code": "Holiday", - "name": "Holiday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Friday", - "name": "Friday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Friday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Friday\/coupons\/" - } - } - } - ] - } -} diff --git a/tests/Responses/promotion/index_response.json b/tests/Responses/promotion/index_response.json deleted file mode 100644 index fd22043f726..00000000000 --- a/tests/Responses/promotion/index_response.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 3, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/promotions\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/promotions\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "Sunday", - "name": "Sunday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Sunday" - } - } - }, - { - "id": @integer@, - "code": "Holiday", - "name": "Holiday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Friday", - "name": "Friday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Friday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Friday\/coupons\/" - } - } - } - ] - } -} diff --git a/tests/Responses/promotion/only_coupon_based_index_response.json b/tests/Responses/promotion/only_coupon_based_index_response.json deleted file mode 100644 index a35f524489b..00000000000 --- a/tests/Responses/promotion/only_coupon_based_index_response.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 4, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/?criteria%5BcouponBased%5D=true&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/promotions\/?criteria%5BcouponBased%5D=true&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/promotions\/?criteria%5BcouponBased%5D=true&page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "AUTUMNAL_PROMO", - "name": "Autumnal special", - "priority": 7, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "WEEKEND_PROMO", - "name": "Weekend special", - "priority": 6, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Holiday", - "name": "Holiday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Friday", - "name": "Friday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Friday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Friday\/coupons\/" - } - } - } - ] - } -} diff --git a/tests/Responses/promotion/show_response.json b/tests/Responses/promotion/show_response.json deleted file mode 100644 index 07a0aa90b93..00000000000 --- a/tests/Responses/promotion/show_response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": @integer@, - "code": "Holiday", - "name": "Holiday promotion", - "priority": 0, - "exclusive": false, - "used": 0, - "couponBased": true, - "rules": [], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/" - } - } -} diff --git a/tests/Responses/promotion/show_response_after_partial_update.json b/tests/Responses/promotion/show_response_after_partial_update.json deleted file mode 100644 index 292693ac884..00000000000 --- a/tests/Responses/promotion/show_response_after_partial_update.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": @integer@, - "code": "Sunday", - "name": "Sunday promotion", - "priority": 0, - "exclusive": true, - "used": 0, - "couponBased": false, - "rules": [], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Sunday" - } - } -} diff --git a/tests/Responses/promotion/show_response_after_update.json b/tests/Responses/promotion/show_response_after_update.json deleted file mode 100644 index 51ac1e7caee..00000000000 --- a/tests/Responses/promotion/show_response_after_update.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "id": @integer@, - "code": "Sunday", - "name": "Monday promotion", - "priority": 0, - "exclusive": false, - "used": 0, - "couponBased": false, - "rules": [], - "actions": [], - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "channels": [], - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Sunday" - } - } -} diff --git a/tests/Responses/promotion/sorted_by_code_index_response.json b/tests/Responses/promotion/sorted_by_code_index_response.json deleted file mode 100644 index c0005bb2abe..00000000000 --- a/tests/Responses/promotion/sorted_by_code_index_response.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 8, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/?sorting%5Bcode%5D=asc&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/promotions\/?sorting%5Bcode%5D=asc&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/promotions\/?sorting%5Bcode%5D=asc&page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "AUTUMNAL_PROMO", - "name": "Autumnal special", - "priority": 7, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Friday", - "name": "Friday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Friday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Friday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Holiday", - "name": "Holiday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "PR_3", - "name": "Sale 3", - "priority": 3, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_3" - } - } - }, - { - "id": @integer@, - "code": "PR_4", - "name": "Sale 4", - "priority": 4, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_4" - } - } - }, - { - "id": @integer@, - "code": "PR_5", - "name": "Sale 5", - "priority": 5, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_5" - } - } - }, - { - "id": @integer@, - "code": "Sunday", - "name": "Sunday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Sunday" - } - } - }, - { - "id": @integer@, - "code": "WEEKEND_PROMO", - "name": "Weekend special", - "priority": 6, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO\/coupons\/" - } - } - } - ] - } -} diff --git a/tests/Responses/promotion/sorted_by_name_index_response.json b/tests/Responses/promotion/sorted_by_name_index_response.json deleted file mode 100644 index 7a05de0c3c0..00000000000 --- a/tests/Responses/promotion/sorted_by_name_index_response.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 8, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/?sorting%5Bname%5D=desc&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/promotions\/?sorting%5Bname%5D=desc&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/promotions\/?sorting%5Bname%5D=desc&page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "WEEKEND_PROMO", - "name": "Weekend special", - "priority": 6, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Sunday", - "name": "Sunday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Sunday" - } - } - }, - { - "id": @integer@, - "code": "PR_5", - "name": "Sale 5", - "priority": 5, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_5" - } - } - }, - { - "id": @integer@, - "code": "PR_4", - "name": "Sale 4", - "priority": 4, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_4" - } - } - }, - { - "id": @integer@, - "code": "PR_3", - "name": "Sale 3", - "priority": 3, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_3" - } - } - }, - { - "id": @integer@, - "code": "Holiday", - "name": "Holiday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Friday", - "name": "Friday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Friday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Friday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "AUTUMNAL_PROMO", - "name": "Autumnal special", - "priority": 7, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO\/coupons\/" - } - } - } - ] - } -} diff --git a/tests/Responses/promotion/sorted_by_priority_index_response.json b/tests/Responses/promotion/sorted_by_priority_index_response.json deleted file mode 100644 index 21718095c3b..00000000000 --- a/tests/Responses/promotion/sorted_by_priority_index_response.json +++ /dev/null @@ -1,121 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 8, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/?sorting%5Bpriority%5D=asc&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/promotions\/?sorting%5Bpriority%5D=asc&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/promotions\/?sorting%5Bpriority%5D=asc&page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "Sunday", - "name": "Sunday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Sunday" - } - } - }, - { - "id": @integer@, - "code": "Holiday", - "name": "Holiday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "Friday", - "name": "Friday promotion", - "priority": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Friday" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/Friday\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "PR_3", - "name": "Sale 3", - "priority": 3, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_3" - } - } - }, - { - "id": @integer@, - "code": "PR_4", - "name": "Sale 4", - "priority": 4, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_4" - } - } - }, - { - "id": @integer@, - "code": "PR_5", - "name": "Sale 5", - "priority": 5, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/PR_5" - } - } - }, - { - "id": @integer@, - "code": "WEEKEND_PROMO", - "name": "Weekend special", - "priority": 6, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/WEEKEND_PROMO\/coupons\/" - } - } - }, - { - "id": @integer@, - "code": "AUTUMNAL_PROMO", - "name": "Autumnal special", - "priority": 7, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO" - }, - "coupons": { - "href": "\/api\/v1\/promotions\/AUTUMNAL_PROMO\/coupons\/" - } - } - } - ] - } -} diff --git a/tests/Responses/promotion_coupon/create_advanced_response.json b/tests/Responses/promotion_coupon/create_advanced_response.json deleted file mode 100644 index 6a78406aae8..00000000000 --- a/tests/Responses/promotion_coupon/create_advanced_response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": @integer@, - "code": "1234", - "usageLimit": 10, - "used": 0, - "expiresAt": "@string@.isDateTime()", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "perCustomerUsageLimit": 1, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/1234" - }, - "promotion": { - "href": "\/api\/v1\/promotions\/Holiday" - } - } -} diff --git a/tests/Responses/promotion_coupon/create_response.json b/tests/Responses/promotion_coupon/create_response.json deleted file mode 100644 index 5b61564c3a9..00000000000 --- a/tests/Responses/promotion_coupon/create_response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": @integer@, - "code": "1234", - "used": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/1234" - }, - "promotion": { - "href": "\/api\/v1\/promotions\/Holiday" - } - } -} diff --git a/tests/Responses/promotion_coupon/create_validation_fail_response.json b/tests/Responses/promotion_coupon/create_validation_fail_response.json deleted file mode 100644 index a213940a2cf..00000000000 --- a/tests/Responses/promotion_coupon/create_validation_fail_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "usageLimit": {}, - "expiresAt": {}, - "perCustomerUsageLimit": {}, - "reusableFromCancelledOrders": {}, - "code": { - "errors": [ - "Please enter coupon code." - ] - } - } - } -} diff --git a/tests/Responses/promotion_coupon/index_response.json b/tests/Responses/promotion_coupon/index_response.json deleted file mode 100644 index 74eb1c5923c..00000000000 --- a/tests/Responses/promotion_coupon/index_response.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 2, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "1765C", - "used": 0, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/1765C" - } - } - }, - { - "id": @integer@, - "code": "CAE14", - "usageLimit": 4, - "used": 3, - "expiresAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/CAE14" - } - } - } - ] - } -} diff --git a/tests/Responses/promotion_coupon/partial_update_response.json b/tests/Responses/promotion_coupon/partial_update_response.json deleted file mode 100644 index bdf7ca62839..00000000000 --- a/tests/Responses/promotion_coupon/partial_update_response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": @integer@, - "code": "CAE14", - "usageLimit": 30, - "used": 3, - "expiresAt": "@string@.isDateTime()", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "perCustomerUsageLimit": 1, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/CAE14" - }, - "promotion": { - "href": "\/api\/v1\/promotions\/Holiday" - } - } -} diff --git a/tests/Responses/promotion_coupon/show_response.json b/tests/Responses/promotion_coupon/show_response.json deleted file mode 100644 index ad4eab96d39..00000000000 --- a/tests/Responses/promotion_coupon/show_response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "id": @integer@, - "code": "1765C", - "used": 0, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/1765C" - }, - "promotion": { - "href": "\/api\/v1\/promotions\/Holiday" - } - } -} diff --git a/tests/Responses/promotion_coupon/update_response.json b/tests/Responses/promotion_coupon/update_response.json deleted file mode 100644 index 9e127a87bab..00000000000 --- a/tests/Responses/promotion_coupon/update_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "id": @integer@, - "code": "CAE14", - "usageLimit": 30, - "used": 3, - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "perCustomerUsageLimit": 2, - "_links": { - "self": { - "href": "\/api\/v1\/promotions\/Holiday\/coupons\/CAE14" - }, - "promotion": { - "href": "\/api\/v1\/promotions\/Holiday" - } - } -} diff --git a/tests/Responses/province/show_response.json b/tests/Responses/province/show_response.json deleted file mode 100644 index b00df19f24e..00000000000 --- a/tests/Responses/province/show_response.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "id": @integer@, - "code": "be_lim", - "name": "Limburg", - "abbreviation": "lim", - "_links": { - "self": { - "href": "\/api\/v1\/countries\/BE\/provinces\/be_lim" - }, - "country": { - "href": "\/api\/v1\/countries\/BE" - } - } -} diff --git a/tests/Responses/shipment/shipment_index_response.json b/tests/Responses/shipment/shipment_index_response.json deleted file mode 100644 index 2520dfeb861..00000000000 --- a/tests/Responses/shipment/shipment_index_response.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 1, - "_links": { - "self": { - "href": "\/api\/v1\/shipments\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/shipments\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/shipments\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "state": "ready", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } - } - ] - } -} diff --git a/tests/Responses/shipment/shipment_show_response.json b/tests/Responses/shipment/shipment_show_response.json deleted file mode 100644 index c9e08133215..00000000000 --- a/tests/Responses/shipment/shipment_show_response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": @integer@, - "state": "ready", - "method": { - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - "_links": { - "self": { - "href": "@string@" - }, - "shipping-method": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "order": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/shipping_category/create_response.json b/tests/Responses/shipping_category/create_response.json deleted file mode 100644 index 37611442046..00000000000 --- a/tests/Responses/shipping_category/create_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "code": "reg", - "name": "Regular", - "description": "Regular weight items", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/shipping_category/create_validation_fail_response.json b/tests/Responses/shipping_category/create_validation_fail_response.json deleted file mode 100644 index 6403c26013d..00000000000 --- a/tests/Responses/shipping_category/create_validation_fail_response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "name": { - "errors": [ - "Please enter shipping category name." - ] - }, - "description": [], - "code": { - "errors": [ - "Please enter shipping category code." - ] - } - } - } -} diff --git a/tests/Responses/shipping_category/index_response.json b/tests/Responses/shipping_category/index_response.json deleted file mode 100644 index b40caba9700..00000000000 --- a/tests/Responses/shipping_category/index_response.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 3, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-categories\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/shipping-categories\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/shipping-categories\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "SC1", - "name": "Shipping Category 1", - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "SC2", - "name": "Shipping Category 2", - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "SC3", - "name": "Shipping Category 3", - "_links": { - "self": { - "href": "@string@" - } - } - } - ] - } -} diff --git a/tests/Responses/shipping_category/show_response.json b/tests/Responses/shipping_category/show_response.json deleted file mode 100644 index 067e7ef4336..00000000000 --- a/tests/Responses/shipping_category/show_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "code": "SC2", - "name": "Shipping Category 2", - "description": "@string@", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/shipping-categories\/SC2" - } - } -} diff --git a/tests/Responses/shipping_category/update_response.json b/tests/Responses/shipping_category/update_response.json deleted file mode 100644 index 3309619e0a7..00000000000 --- a/tests/Responses/shipping_category/update_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "code": "SC1", - "name": "Light", - "description": "Light weight items", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/shipping_category/update_validation_fail_response.json b/tests/Responses/shipping_category/update_validation_fail_response.json deleted file mode 100644 index 4ba3d0d1d9d..00000000000 --- a/tests/Responses/shipping_category/update_validation_fail_response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "name": { - "errors": [ - "Please enter shipping category name." - ] - }, - "description": [], - "code": [] - } - } -} diff --git a/tests/Responses/shipping_method/show_response.json b/tests/Responses/shipping_method/show_response.json deleted file mode 100644 index 6e33c920f53..00000000000 --- a/tests/Responses/shipping_method/show_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "code": "UPS", - "enabled": true, - "_links": { - "self": { - "href": "\/api\/v1\/shipping-methods\/UPS" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } -} \ No newline at end of file diff --git a/tests/Responses/tax_category/create_response.json b/tests/Responses/tax_category/create_response.json deleted file mode 100644 index 54fc714ec9e..00000000000 --- a/tests/Responses/tax_category/create_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "code": "clothing", - "name": "Clothing", - "description": "All items classified as clothing.", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/tax_category/create_validation_fail_response.json b/tests/Responses/tax_category/create_validation_fail_response.json deleted file mode 100644 index 54b4c6046b2..00000000000 --- a/tests/Responses/tax_category/create_validation_fail_response.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "name": { - "errors": [ - "Please enter tax category name." - ] - }, - "description": [], - "code": { - "errors": [ - "Please enter tax category code." - ] - } - } - } -} diff --git a/tests/Responses/tax_category/filtered_by_code_index_response.json b/tests/Responses/tax_category/filtered_by_code_index_response.json deleted file mode 100644 index bafa3b086c1..00000000000 --- a/tests/Responses/tax_category/filtered_by_code_index_response.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 5, - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/?criteria%5Bsearch%5D=TC1&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/tax-categories\/?criteria%5Bsearch%5D=TC1&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/tax-categories\/?criteria%5Bsearch%5D=TC1&page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "TC1", - "name": "Tax Category 1", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC1" - } - } - }, - { - "id": @integer@, - "code": "TC2", - "name": "Tax Category 2", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC2" - } - } - }, - { - "id": @integer@, - "code": "TC3", - "name": "Tax Category 3", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC3" - } - } - }, - { - "id": @integer@, - "code": "TC4", - "name": "Clothing", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC4" - } - } - }, - { - "id": @integer@, - "code": "TC5", - "name": "Clothing & Accessories", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC5" - } - } - } - ] - } -} diff --git a/tests/Responses/tax_category/filtered_by_name_index_response.json b/tests/Responses/tax_category/filtered_by_name_index_response.json deleted file mode 100644 index 00c5930993a..00000000000 --- a/tests/Responses/tax_category/filtered_by_name_index_response.json +++ /dev/null @@ -1,71 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 5, - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/?criteria%5Bsearch%5D=clothing&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/tax-categories\/?criteria%5Bsearch%5D=clothing&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/tax-categories\/?criteria%5Bsearch%5D=clothing&page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "TC1", - "name": "Tax Category 1", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC1" - } - } - }, - { - "id": @integer@, - "code": "TC2", - "name": "Tax Category 2", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC2" - } - } - }, - { - "id": @integer@, - "code": "TC3", - "name": "Tax Category 3", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC3" - } - } - }, - { - "id": @integer@, - "code": "TC4", - "name": "Clothing", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC4" - } - } - }, - { - "id": @integer@, - "code": "TC5", - "name": "Clothing & Accessories", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC5" - } - } - } - ] - } -} diff --git a/tests/Responses/tax_category/index_response.json b/tests/Responses/tax_category/index_response.json deleted file mode 100644 index 836c02439ca..00000000000 --- a/tests/Responses/tax_category/index_response.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 3, - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/tax-categories\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/tax-categories\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "TC1", - "name": "Tax Category 1", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC1" - } - } - }, - { - "id": @integer@, - "code": "TC2", - "name": "Tax Category 2", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC2" - } - } - }, - { - "id": @integer@, - "code": "TC3", - "name": "Tax Category 3", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC3" - } - } - } - ] - } -} diff --git a/tests/Responses/tax_category/partial_update_response.json b/tests/Responses/tax_category/partial_update_response.json deleted file mode 100644 index 781ff3b8eae..00000000000 --- a/tests/Responses/tax_category/partial_update_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "code": "TC1", - "name": "Clothing & Accessories", - "description": "@string@", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/tax_category/show_response.json b/tests/Responses/tax_category/show_response.json deleted file mode 100644 index 65816a6995d..00000000000 --- a/tests/Responses/tax_category/show_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "code": "TC1", - "name": "Tax Category 1", - "description": "@string@", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/tax_category/sorted_index_response.json b/tests/Responses/tax_category/sorted_index_response.json deleted file mode 100644 index 31030bcb8c8..00000000000 --- a/tests/Responses/tax_category/sorted_index_response.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 3, - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/?sorting%5BnameAndDescription%5D=asc&page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/tax-categories\/?sorting%5BnameAndDescription%5D=asc&page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/tax-categories\/?sorting%5BnameAndDescription%5D=asc&page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "TC1", - "name": "Tax Category 1", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC1" - } - } - }, - { - "id": @integer@, - "code": "TC2", - "name": "Tax Category 2", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC2" - } - } - }, - { - "id": @integer@, - "code": "TC3", - "name": "Tax Category 3", - "_links": { - "self": { - "href": "\/api\/v1\/tax-categories\/TC3" - } - } - } - ] - } -} diff --git a/tests/Responses/tax_category/update_response.json b/tests/Responses/tax_category/update_response.json deleted file mode 100644 index b5588b0d60d..00000000000 --- a/tests/Responses/tax_category/update_response.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "id": @integer@, - "code": "TC1", - "name": "Clothing & Accessories", - "description": "All items classified as clothing with accessories.", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/tax_category/update_validation_fail_response.json b/tests/Responses/tax_category/update_validation_fail_response.json deleted file mode 100644 index 90b8470839d..00000000000 --- a/tests/Responses/tax_category/update_validation_fail_response.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "name": { - "errors": [ - "Please enter tax category name." - ] - }, - "description": [], - "code": [] - } - } -} diff --git a/tests/Responses/tax_rate/index_response.json b/tests/Responses/tax_rate/index_response.json deleted file mode 100644 index 6730326aa93..00000000000 --- a/tests/Responses/tax_rate/index_response.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 2, - "_links": { - "self": { - "href": "\/api\/v1\/tax-rates\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/tax-rates\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/tax-rates\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "sales_tax", - "name": "Sales Tax 20%", - "amount": 0, - "includedInPrice": false, - "calculator": "flat_rate", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-rates\/sales_tax" - }, - "category": { - "href": "\/api\/v1\/tax-categories\/TC1" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - }, - { - "id": @integer@, - "code": "regular_tax", - "name": "Regular Tax 20%", - "amount": 0, - "includedInPrice": false, - "calculator": "flat_rate", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-rates\/regular_tax" - }, - "category": { - "href": "\/api\/v1\/tax-categories\/TC2" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } - } - - ] - } -} diff --git a/tests/Responses/tax_rate/show_response.json b/tests/Responses/tax_rate/show_response.json deleted file mode 100644 index 98a9f36ce35..00000000000 --- a/tests/Responses/tax_rate/show_response.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "id": @integer@, - "code": "sales_tax", - "name": "Sales Tax 20%", - "amount": 0, - "includedInPrice": false, - "calculator": "flat_rate", - "createdAt": "@string@.isDateTime()", - "updatedAt": "@string@.isDateTime()", - "_links": { - "self": { - "href": "\/api\/v1\/tax-rates\/sales_tax" - }, - "category": { - "href": "\/api\/v1\/tax-categories\/TC1" - }, - "zone": { - "href": "\/api\/v1\/zones\/EU" - } - } -} diff --git a/tests/Responses/taxon/create_root_response.json b/tests/Responses/taxon/create_root_response.json deleted file mode 100644 index b7735c65043..00000000000 --- a/tests/Responses/taxon/create_root_response.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "id": @integer@, - "code": "fluffy_pets", - "children": [], - "left": 1, - "right": 2, - "level": 0, - "position": 0, - "translations": { - "en_US": { - "locale": "en_US" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/taxon/create_root_with_multiple_translations_response.json b/tests/Responses/taxon/create_root_with_multiple_translations_response.json deleted file mode 100644 index b0622f87e62..00000000000 --- a/tests/Responses/taxon/create_root_with_multiple_translations_response.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "id": @integer@, - "name": "Fluffy Pets", - "code": "fluffy_pets", - "children": [], - "left": 1, - "right": 2, - "level": 0, - "position": 0, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Fluffy Pets", - "slug": "fluffy-pets" - }, - "nl_NL": { - "id": @integer@, - "locale": "nl_NL", - "name": "Pluizige Huisdieren", - "slug": "pluizige-huisdieren" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/taxon/create_validation_fail_response.json b/tests/Responses/taxon/create_validation_fail_response.json deleted file mode 100644 index 8af38bd0c04..00000000000 --- a/tests/Responses/taxon/create_validation_fail_response.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "children": { - "translations": {}, - "enabled": {}, - "images": {}, - "code": { - "errors": [ - "Please enter taxon code." - ] - }, - "parent": {} - } - } -} diff --git a/tests/Responses/taxon/create_with_images_response.json b/tests/Responses/taxon/create_with_images_response.json deleted file mode 100644 index 4e81172b99d..00000000000 --- a/tests/Responses/taxon/create_with_images_response.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "id": @integer@, - "code": "toys", - "children": [], - "left": 1, - "right": 2, - "level": 0, - "position": 0, - "translations": { - "en_US": { - "locale": "en_US" - } - }, - "images": [ - { - "id": @integer@, - "type": "ford", - "path": "@string@" - }, - { - "id": @integer@, - "type": "mugs", - "path": "@string@" - } - ], - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/taxon/create_with_multiple_translations_response.json b/tests/Responses/taxon/create_with_multiple_translations_response.json deleted file mode 100644 index fc198566c92..00000000000 --- a/tests/Responses/taxon/create_with_multiple_translations_response.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "id": @integer@, - "name": "Fluffy Pets", - "code": "fluffy_pets", - "root": { - "id": @integer@, - "code": "category", - "children": [ - { - "id": @integer@, - "code": "mugs", - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 1, - "right": 16, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "children": [ - { - "id": @integer@, - "code": "mugs", - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 1, - "right": 16, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "children": [], - "left": 14, - "right": 15, - "level": 1, - "position": 4, - "translations": { - "en_US": { - "id": @integer@, - "locale": "en_US", - "name": "Fluffy Pets", - "slug": "fluffy-pets" - }, - "nl_NL": { - "id": @integer@, - "locale": "nl_NL", - "name": "Pluizige Huisdieren", - "slug": "pluizige-huisdieren" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/taxon/create_with_parent_response.json b/tests/Responses/taxon/create_with_parent_response.json deleted file mode 100644 index f2dae28466a..00000000000 --- a/tests/Responses/taxon/create_with_parent_response.json +++ /dev/null @@ -1,157 +0,0 @@ -{ - "id": @integer@, - "code": "horror", - "root": { - "id": @integer@, - "code": "category", - "children": [ - { - "id": @integer@, - "code": "mugs", - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 9, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 10, - "right": 15, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 1, - "right": 16, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "books", - "root": { - "id": @integer@, - "code": "category", - "children": [], - "left": 1, - "right": 16, - "level": 0, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "children": [], - "left": 1, - "right": 16, - "level": 0, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "children": [], - "left": 6, - "right": 9, - "level": 1, - "position": 2, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "children": [], - "left": 7, - "right": 8, - "level": 2, - "position": 0, - "translations": { - "en_US": { - "locale": "en_US" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/taxon/index_response.json b/tests/Responses/taxon/index_response.json deleted file mode 100644 index 1d13bbfc47b..00000000000 --- a/tests/Responses/taxon/index_response.json +++ /dev/null @@ -1,281 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 7, - "_links": { - "self": { - "href": "\/api\/v1\/taxons\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/taxons\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/taxons\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "category", - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "mugs", - "root": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "stickers", - "root": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "position": 1, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "books", - "root": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "position": 2, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "t-shirts", - "root": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "position": 3, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "men", - "root": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "t-shirts", - "root": @array@, - "parent": @array@, - "position": 3, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "women", - "root": { - "id": @integer@, - "code": "category", - "position": 0, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "t-shirts", - "root": @array@, - "parent": @array@, - "position": 3, - "translations": @array@, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "position": 1, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ] - } -} diff --git a/tests/Responses/taxon/paginated_index_response.json b/tests/Responses/taxon/paginated_index_response.json deleted file mode 100644 index 95b8d70665d..00000000000 --- a/tests/Responses/taxon/paginated_index_response.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "page": 2, - "limit": 10, - "pages": 2, - "total": 17, - "_links": { - "self": { - "href": "\/api\/v1\/taxons\/?page=2&limit=10" - }, - "first": { - "href": "\/api\/v1\/taxons\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/taxons\/?page=2&limit=10" - }, - "previous": { - "href": "\/api\/v1\/taxons\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "taxon4", - "position": 4, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "taxon5", - "position": 5, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "taxon6", - "position": 6, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "taxon7", - "position": 7, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "taxon8", - "position": 8, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "taxon9", - "position": 9, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "taxon10", - "position": 10, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ] - } -} diff --git a/tests/Responses/taxon/show_response.json b/tests/Responses/taxon/show_response.json deleted file mode 100644 index c0071f54e16..00000000000 --- a/tests/Responses/taxon/show_response.json +++ /dev/null @@ -1,174 +0,0 @@ -{ - "id": @integer@, - "code": "women", - "root": { - "id": @integer@, - "code": "category", - "children": [ - { - "id": @integer@, - "code": "mugs", - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "t-shirts", - "children": [], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "t-shirts", - "root": { - "id": @integer@, - "code": "category", - "children": [], - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "parent": { - "id": @integer@, - "code": "category", - "children": [], - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "children": [ - { - "id": @integer@, - "code": "men", - "children": [], - "left": 9, - "right": 10, - "level": 2, - "position": 0, - "translations": [], - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - "children": [], - "left": 11, - "right": 12, - "level": 2, - "position": 1, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/taxon/show_root_response.json b/tests/Responses/taxon/show_root_response.json deleted file mode 100644 index 72aa87e7a3d..00000000000 --- a/tests/Responses/taxon/show_root_response.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "id": @integer@, - "code": "category", - "children": [ - { - "id": @integer@, - "code": "mugs", - "children": [], - "left": 2, - "right": 3, - "level": 1, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "stickers", - "children": [], - "left": 4, - "right": 5, - "level": 1, - "position": 1, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "books", - "children": [], - "left": 6, - "right": 7, - "level": 1, - "position": 2, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "t-shirts", - "children": [ - { - "id": @integer@, - "code": "men", - "children": [], - "left": 9, - "right": 10, - "level": 2, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - }, - { - "id": @integer@, - "code": "women", - "children": [], - "left": 11, - "right": 12, - "level": 2, - "position": 1, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 8, - "right": 13, - "level": 1, - "position": 3, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } - } - ], - "left": 1, - "right": 14, - "level": 0, - "position": 0, - "translations": { - "en": { - "locale": "en" - } - }, - "images": [], - "_links": { - "self": { - "href": "@string@" - } - } -} diff --git a/tests/Responses/taxon/update_validation_fail_response.json b/tests/Responses/taxon/update_validation_fail_response.json deleted file mode 100644 index 1a7a69fff4c..00000000000 --- a/tests/Responses/taxon/update_validation_fail_response.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "code": 400, - "message": "The productTaxon position \"second\" is invalid." -} diff --git a/tests/Responses/zone/create_response.json b/tests/Responses/zone/create_response.json deleted file mode 100644 index a25c0ed82fc..00000000000 --- a/tests/Responses/zone/create_response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": @integer@, - "code": "EU", - "name": "European Union", - "scope": "all", - "type": "country", - "members": [ - { - "id": @integer@, - "code": "NL" - }, - { - "id": @integer@, - "code": "BE" - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/zones\/EU" - } - } -} diff --git a/tests/Responses/zone/create_validation_fail_response.json b/tests/Responses/zone/create_validation_fail_response.json deleted file mode 100644 index 77f06a7e8ae..00000000000 --- a/tests/Responses/zone/create_validation_fail_response.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "errors": [ - "Please add at least 1 zone member." - ], - "children": { - "name": { - "errors": [ - "Please enter zone name." - ] - }, - "type": {}, - "members": {}, - "scope": { - "errors": [ - "Please enter the scope." - ] - }, - "code": { - "errors": [ - "Please enter zone code." - ] - } - } - } -} diff --git a/tests/Responses/zone/index_response.json b/tests/Responses/zone/index_response.json deleted file mode 100644 index e069be0c1e0..00000000000 --- a/tests/Responses/zone/index_response.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "page": 1, - "limit": 10, - "pages": 1, - "total": 1, - "_links": { - "self": { - "href": "\/api\/v1\/zones\/?page=1&limit=10" - }, - "first": { - "href": "\/api\/v1\/zones\/?page=1&limit=10" - }, - "last": { - "href": "\/api\/v1\/zones\/?page=1&limit=10" - } - }, - "_embedded": { - "items": [ - { - "id": @integer@, - "code": "EU", - "name": "European Union", - "type": "country", - "_links": { - "self": { - "href": "\/api\/v1\/zones\/EU" - } - } - } - ] - } -} diff --git a/tests/Responses/zone/show_response.json b/tests/Responses/zone/show_response.json deleted file mode 100644 index 042a37e36ac..00000000000 --- a/tests/Responses/zone/show_response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": @integer@, - "code": "EU", - "name": "European Union", - "type": "country", - "scope": "all", - "members": [ - { - "id": @integer@, - "code": "BE" - }, - { - "id": @integer@, - "code": "NL" - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/zones\/EU" - } - } -} diff --git a/tests/Responses/zone/update_partially_response.json b/tests/Responses/zone/update_partially_response.json deleted file mode 100644 index ef4cc52e1c7..00000000000 --- a/tests/Responses/zone/update_partially_response.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": @integer@, - "code": "EU", - "name": "European Union +", - "type": "country", - "scope": "all", - "members": [ - { - "id": @integer@, - "code": "BE" - }, - { - "id": @integer@, - "code": "NL" - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/zones\/EU" - } - } -} diff --git a/tests/Responses/zone/update_response.json b/tests/Responses/zone/update_response.json deleted file mode 100644 index 103f42d7f25..00000000000 --- a/tests/Responses/zone/update_response.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "id": @integer@, - "code": "EU", - "name": "European Union +", - "type": "country", - "scope": "all", - "members": [ - { - "id": @integer@, - "code": "PL" - } - ], - "_links": { - "self": { - "href": "\/api\/v1\/zones\/EU" - } - } -} diff --git a/tests/Responses/zone/update_validation_fail_response.json b/tests/Responses/zone/update_validation_fail_response.json deleted file mode 100644 index d8056ee923c..00000000000 --- a/tests/Responses/zone/update_validation_fail_response.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "code": 400, - "message": "Validation Failed", - "errors": { - "errors": [ - "Please add at least 1 zone member." - ], - "children": { - "name": { - "errors": [ - "Please enter zone name." - ] - }, - "type": {}, - "members": {}, - "scope": { - "errors": [ - "Please enter the scope." - ] - }, - "code": {} - } - } -}