Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Maintenance] EOT to JSON rename #483

Merged
merged 1 commit into from
Jul 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tests/Controller/AddressBook/AddressBookCreateAddressApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function it_allows_user_to_add_new_address_to_address_book(): void
$this->logInUser('oliver@queen.com', '123password');

$data =
<<<EOT
<<<JSON
{
"firstName": "Jurica",
"lastName": "Separovic",
Expand All @@ -36,7 +36,7 @@ public function it_allows_user_to_add_new_address_to_address_book(): void
"countryCode": "GB",
"postcode": "2433"
}
EOT;
JSON;

$response = $this->createAddress($data);
$this->assertResponse($response, 'address_book/add_address_response', Response::HTTP_CREATED);
Expand Down Expand Up @@ -65,7 +65,7 @@ public function it_does_not_allow_user_to_add_new_address_to_address_book_withou
$this->logInUser('oliver@queen.com', '123password');

$data =
<<<EOT
<<<JSON
{
"firstName": "",
"lastName": "",
Expand All @@ -75,7 +75,7 @@ public function it_does_not_allow_user_to_add_new_address_to_address_book_withou
"countryCode": "",
"postcode": ""
}
EOT;
JSON;

$response = $this->createAddress($data);
$this->assertResponse($response, 'address_book/validation_create_address_book_response', Response::HTTP_BAD_REQUEST);
Expand All @@ -90,7 +90,7 @@ public function it_does_not_allow_user_to_add_new_address_to_address_book_withou
$this->logInUser('oliver@queen.com', '123password');

$data =
<<<EOT
<<<JSON
{
"firstName": "Davor",
"lastName": "Duhovic",
Expand All @@ -99,7 +99,7 @@ public function it_does_not_allow_user_to_add_new_address_to_address_book_withou
"city": "Split",
"postcode": "2100"
}
EOT;
JSON;

$response = $this->createAddress($data);
$this->assertResponse($response, 'address_book/validation_create_address_book_with_wrong_country_response', Response::HTTP_BAD_REQUEST);
Expand All @@ -114,7 +114,7 @@ public function it_does_not_allow_user_to_add_new_address_to_address_book_withou
$this->logInUser('oliver@queen.com', '123password');

$data =
<<<EOT
<<<JSON
{
"firstName": "Davor",
"lastName": "Duhovic",
Expand All @@ -124,7 +124,7 @@ public function it_does_not_allow_user_to_add_new_address_to_address_book_withou
"postcode": "2100",
"provinceCode": "WRONG_PROVINCE_CODE"
}
EOT;
JSON;

$response = $this->createAddress($data);
$this->assertResponse($response, 'address_book/validation_create_address_book_with_wrong_province_response', Response::HTTP_INTERNAL_SERVER_ERROR);
Expand Down
12 changes: 6 additions & 6 deletions tests/Controller/AddressBook/AddressBookUpdateAddressApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function it_updates_address_in_address_book(): void
$address = $addressRepository->findOneBy(['street' => 'Kupreska']);

$data =
<<<EOT
<<<JSON
{
"firstName": "New name",
"lastName": "New lastName",
Expand All @@ -41,7 +41,7 @@ public function it_updates_address_in_address_book(): void
"postcode": "2000",
"phoneNumber": "0918972132"
}
EOT;
JSON;

$response = $this->updateAddress((string) $address->getId(), $data);
$this->assertResponse($response, 'address_book/update_address', Response::HTTP_OK);
Expand Down Expand Up @@ -71,7 +71,7 @@ public function it_does_not_allow_to_update_address_if_country_or_province_code_
$address = $addressRepository->findOneBy(['street' => 'Kupreska']);

$data =
<<<EOT
<<<JSON
{
"firstName": "New name",
"lastName": "New lastName",
Expand All @@ -83,7 +83,7 @@ public function it_does_not_allow_to_update_address_if_country_or_province_code_
"postcode": "2000",
"phoneNumber": "0918972132"
}
EOT;
JSON;

$response = $this->updateAddress((string) $address->getId(), $data);
$this->assertResponseCode($response, Response::HTTP_BAD_REQUEST);
Expand All @@ -103,7 +103,7 @@ public function it_does_not_allow_to_update_address_without_passing_required_dat
$address = $addressRepository->findOneBy(['street' => 'Kupreska']);

$data =
<<<EOT
<<<JSON
{
"firstName": "",
"lastName": "",
Expand All @@ -112,7 +112,7 @@ public function it_does_not_allow_to_update_address_without_passing_required_dat
"city": "",
"postcode": "",
}
EOT;
JSON;

$response = $this->updateAddress((string) $address->getId(), $data);
$this->assertResponseCode($response, Response::HTTP_BAD_REQUEST);
Expand Down
20 changes: 10 additions & 10 deletions tests/Controller/Cart/CartAddCouponShopApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public function it_allows_to_add_promotion_coupon_to_the_cart(): void
$bus->dispatch(new PutSimpleItemToCart($token, 'LOGAN_MUG_CODE', 5));

$data =
<<<EOT
<<<JSON
{
"coupon": "BANANAS"
}
EOT;
JSON;

$this->client->request('PUT', sprintf('/shop-api/carts/%s/coupon', $token), [], [], self::CONTENT_TYPE_HEADER, $data);

Expand Down Expand Up @@ -69,11 +69,11 @@ public function it_does_not_allow_to_add_promotion_code_if_cart_does_not_exists(
$this->loadFixturesFromFiles(['channel.yml', 'shop.yml']);

$data =
<<<EOT
<<<JSON
{
"coupon": "BANANAS"
}
EOT;
JSON;

$this->client->request('PUT', '/shop-api/carts/WRONGTOKEN/coupon', [], [], self::CONTENT_TYPE_HEADER, $data);

Expand All @@ -97,11 +97,11 @@ public function it_does_not_allow_to_add_promotion_code_if_promotion_code_does_n
$bus->dispatch(new PutSimpleItemToCart($token, 'LOGAN_MUG_CODE', 5));

$data =
<<<EOT
<<<JSON
{
"coupon": "BANANAS"
}
EOT;
JSON;

$this->client->request('PUT', sprintf('/shop-api/carts/%s/coupon', $token), [], [], self::CONTENT_TYPE_HEADER, $data);

Expand All @@ -125,11 +125,11 @@ public function it_does_not_allow_to_add_promotion_code_if_code_is_invalid(): vo
$bus->dispatch(new PutSimpleItemToCart($token, 'LOGAN_MUG_CODE', 5));

$data =
<<<EOT
<<<JSON
{
"coupon": "USED_BANANA"
}
EOT;
JSON;

$this->client->request('PUT', sprintf('/shop-api/carts/%s/coupon', $token), [], [], self::CONTENT_TYPE_HEADER, $data);

Expand All @@ -153,11 +153,11 @@ public function it_does_not_allow_to_add_promotion_code_if_related_promotion_is_
$bus->dispatch(new PutSimpleItemToCart($token, 'LOGAN_MUG_CODE', 5));

$data =
<<<EOT
<<<JSON
{
"coupon": "PINEAPPLE"
}
EOT;
JSON;

$this->client->request('PUT', sprintf('/shop-api/carts/%s/coupon', $token), [], [], self::CONTENT_TYPE_HEADER, $data);

Expand Down
16 changes: 8 additions & 8 deletions tests/Controller/Cart/CartChangeItemQuantityApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ public function it_does_not_allow_to_change_quantity_if_cart_does_not_exists():
$this->loadFixturesFromFiles(['channel.yml', 'shop.yml']);

$data =
<<<EOT
<<<JSON
{
"quantity": 5
}
EOT;
JSON;
$this->client->request('PUT', '/shop-api/carts/SDAOSLEFNWU35H3QLI5325/items/1', [], [], self::CONTENT_TYPE_HEADER, $data);
$response = $this->client->getResponse();

Expand All @@ -48,11 +48,11 @@ public function it_changes_item_quantity(): void
$bus->dispatch(new PutSimpleItemToCart($token, 'LOGAN_MUG_CODE', 3));

$data =
<<<EOT
<<<JSON
{
"quantity": 5
}
EOT;
JSON;
$this->client->request('PUT', '/shop-api/carts/SDAOSLEFNWU35H3QLI5325/items/' . $this->getFirstOrderItemId($token), [], [], self::CONTENT_TYPE_HEADER, $data);
$response = $this->client->getResponse();

Expand All @@ -74,11 +74,11 @@ public function it_does_not_allow_to_set_quantity_lower_than_one(): void
$bus->dispatch(new PutSimpleItemToCart($token, 'LOGAN_MUG_CODE', 3));

$data =
<<<EOT
<<<JSON
{
"quantity": 0
}
EOT;
JSON;
$this->client->request('PUT', '/shop-api/carts/SDAOSLEFNWU35H3QLI5325/items/' . $this->getFirstOrderItemId($token), [], [], self::CONTENT_TYPE_HEADER, $data);
$response = $this->client->getResponse();

Expand Down Expand Up @@ -119,11 +119,11 @@ public function it_does_not_allow_to_change_quantity_if_cart_item_does_not_exist
$bus->dispatch(new PickupCart($token, 'WEB_GB'));

$data =
<<<EOT
<<<JSON
{
"quantity": 5
}
EOT;
JSON;
$this->client->request('PUT', '/shop-api/carts/SDAOSLEFNWU35H3QLI5325/items/420', [], [], self::CONTENT_TYPE_HEADER, $data);
$response = $this->client->getResponse();

Expand Down
Loading