mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-05 20:57:12 +00:00
[Unit] Change nAWw2jewpA token value to token
This commit is contained in:
parent
c33b9ea363
commit
00acfcc5f4
31 changed files with 87 additions and 91 deletions
|
|
@ -24,8 +24,6 @@ final class OrdersTest extends JsonApiTestCase
|
|||
{
|
||||
use OrderPlacerTrait;
|
||||
|
||||
private const TEST_TOKEN_VALUE = 'nAWw2jewpA';
|
||||
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->setUpOrderPlacer();
|
||||
|
|
@ -198,7 +196,7 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
|
||||
$this->placeOrder($tokenValue);
|
||||
|
||||
|
|
@ -219,7 +217,7 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
|
||||
$this->placeOrder($tokenValue);
|
||||
|
||||
|
|
@ -246,7 +244,7 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
|
||||
$this->placeOrder($tokenValue);
|
||||
$this->cancelOrder($tokenValue);
|
||||
|
|
@ -274,7 +272,7 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
|
||||
$this->placeOrder($tokenValue);
|
||||
|
||||
|
|
@ -295,11 +293,9 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$this->placeOrder();
|
||||
|
||||
$this->placeOrder($tokenValue);
|
||||
|
||||
$this->requestGet(uri: sprintf('/api/v2/admin/orders/%s/shipments', $tokenValue));
|
||||
$this->requestGet('/api/v2/admin/orders/token/shipments');
|
||||
|
||||
$this->assertResponseSuccessful('admin/order/get_shipments_of_order');
|
||||
}
|
||||
|
|
@ -317,9 +313,9 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'cart/promotion.yaml',
|
||||
]);
|
||||
|
||||
$this->placeOrder(self::TEST_TOKEN_VALUE);
|
||||
$this->placeOrder();
|
||||
|
||||
$this->requestGet(uri: sprintf('/api/v2/admin/orders/%s/adjustments', self::TEST_TOKEN_VALUE));
|
||||
$this->requestGet('/api/v2/admin/orders/token/adjustments');
|
||||
|
||||
$this->assertResponseSuccessful('admin/order/get_adjustments_for_a_given_order');
|
||||
}
|
||||
|
|
@ -337,10 +333,10 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'cart/promotion.yaml',
|
||||
]);
|
||||
|
||||
$this->placeOrder(self::TEST_TOKEN_VALUE);
|
||||
$this->placeOrder();
|
||||
|
||||
$this->requestGet(
|
||||
uri: sprintf('/api/v2/admin/orders/%s/adjustments', self::TEST_TOKEN_VALUE),
|
||||
uri: '/api/v2/admin/orders/token/adjustments',
|
||||
queryParameters: ['type' => 'order_promotion'],
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ final class PaymentsTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$this->placeOrder('nAWw2jewpA');
|
||||
$this->placeOrder();
|
||||
|
||||
$this->requestGet(uri: '/api/v2/admin/payments');
|
||||
|
||||
|
|
@ -85,9 +85,9 @@ final class PaymentsTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$this->placeOrder('nAWw2jewpA');
|
||||
$this->placeOrder('token');
|
||||
|
||||
$this->requestGet(uri: '/api/v2/admin/orders/nAWw2jewpA');
|
||||
$this->requestGet(uri: '/api/v2/admin/orders/token');
|
||||
$orderResponse = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->requestGet(uri: '/api/v2/admin/payments/' . $orderResponse['payments'][0]['id']);
|
||||
|
|
@ -107,7 +107,7 @@ final class PaymentsTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$order = $this->placeOrder('nAWw2jewpA');
|
||||
$order = $this->placeOrder('token');
|
||||
|
||||
$this->requestPatch(uri: sprintf('/api/v2/admin/payments/%s/complete', $order->getPayments()->first()->getId()));
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ final class PaymentsTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$order = $this->placeOrder('nAWw2jewpA');
|
||||
$order = $this->placeOrder('token');
|
||||
$this->payOrder($order);
|
||||
|
||||
$this->requestPatch(sprintf('/api/v2/admin/payments/%s/complete', $order->getPayments()->first()->getId()));
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ final class ShipmentsTest extends JsonApiTestCase
|
|||
{
|
||||
$this->loadFixturesFromFiles(['authentication/api_administrator.yaml', 'channel/channel.yaml', 'cart.yaml', 'country.yaml', 'shipping_method.yaml', 'payment_method.yaml']);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
$anotherTokenValue = 'nAWw2jexpB';
|
||||
|
||||
$this->placeOrder($tokenValue);
|
||||
|
|
@ -58,7 +58,7 @@ final class ShipmentsTest extends JsonApiTestCase
|
|||
{
|
||||
$this->loadFixturesFromFiles(['authentication/api_administrator.yaml', 'channel/channel.yaml', 'cart.yaml', 'country.yaml', 'shipping_method.yaml', 'payment_method.yaml']);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
|
||||
$order = $this->placeOrder($tokenValue);
|
||||
|
||||
|
|
@ -80,7 +80,7 @@ final class ShipmentsTest extends JsonApiTestCase
|
|||
{
|
||||
$this->loadFixturesFromFiles(['authentication/api_administrator.yaml', 'channel/channel.yaml', 'cart.yaml', 'country.yaml', 'shipping_method.yaml', 'payment_method.yaml']);
|
||||
|
||||
$order = $this->placeOrder('nAWw2jewpA');
|
||||
$order = $this->placeOrder('token');
|
||||
|
||||
$this->client->request(
|
||||
method: 'PATCH',
|
||||
|
|
@ -97,7 +97,7 @@ final class ShipmentsTest extends JsonApiTestCase
|
|||
{
|
||||
$this->loadFixturesFromFiles(['authentication/api_administrator.yaml', 'channel/channel.yaml', 'cart.yaml', 'country.yaml', 'shipping_method.yaml', 'payment_method.yaml']);
|
||||
|
||||
$order = $this->placeOrder('nAWw2jewpA');
|
||||
$order = $this->placeOrder('token');
|
||||
$order->getShipments()->last()->setState('shipped');
|
||||
|
||||
$this->client->request(
|
||||
|
|
@ -116,7 +116,7 @@ final class ShipmentsTest extends JsonApiTestCase
|
|||
{
|
||||
$this->loadFixturesFromFiles(['authentication/api_administrator.yaml', 'channel/channel.yaml', 'cart.yaml', 'country.yaml', 'shipping_method.yaml', 'payment_method.yaml']);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
|
||||
$order = $this->placeOrder($tokenValue);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "/api/v2/contexts/Adjustment",
|
||||
"@id": "/api/v2/admin/orders/nAWw2jewpA/adjustments",
|
||||
"@id": "/api/v2/admin/orders/token/adjustments",
|
||||
"@type": "hydra:Collection",
|
||||
"hydra:totalItems": 4,
|
||||
"hydra:member": [
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
"@type": "Adjustment",
|
||||
"shipment": "/api/v2/admin/shipments/@integer@",
|
||||
"id": "@integer@",
|
||||
"order": "/api/v2/admin/orders/nAWw2jewpA",
|
||||
"order": "/api/v2/admin/orders/token",
|
||||
"orderItem": null,
|
||||
"orderItemUnit": null,
|
||||
"type": "shipping",
|
||||
|
|
@ -63,7 +63,7 @@
|
|||
],
|
||||
"hydra:search": {
|
||||
"@type": "hydra:IriTemplate",
|
||||
"hydra:template": "\/api\/v2\/admin\/orders\/nAWw2jewpA\/adjustments{?}",
|
||||
"hydra:template": "\/api\/v2\/admin\/orders\/token\/adjustments{?}",
|
||||
"hydra:variableRepresentation": "BasicRepresentation",
|
||||
"hydra:mapping": []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "/api/v2/contexts/Adjustment",
|
||||
"@id": "/api/v2/admin/orders/nAWw2jewpA/adjustments",
|
||||
"@id": "/api/v2/admin/orders/token/adjustments",
|
||||
"@type": "hydra:Collection",
|
||||
"hydra:totalItems": 3,
|
||||
"hydra:member": [
|
||||
|
|
@ -48,12 +48,12 @@
|
|||
}
|
||||
],
|
||||
"hydra:view": {
|
||||
"@id": "\/api\/v2\/admin\/orders\/nAWw2jewpA\/adjustments?type=order_promotion",
|
||||
"@id": "\/api\/v2\/admin\/orders\/token\/adjustments?type=order_promotion",
|
||||
"@type": "hydra:PartialCollectionView"
|
||||
},
|
||||
"hydra:search": {
|
||||
"@type": "hydra:IriTemplate",
|
||||
"hydra:template": "\/api\/v2\/admin\/orders\/nAWw2jewpA\/adjustments{?}",
|
||||
"hydra:template": "\/api\/v2\/admin\/orders\/token\/adjustments{?}",
|
||||
"hydra:variableRepresentation": "BasicRepresentation",
|
||||
"hydra:mapping": []
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/admin\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/admin\/orders\/token",
|
||||
"@type": "Order",
|
||||
"customer": "\/api\/v2\/admin\/customers\/@integer@",
|
||||
"channel": "\/api\/v2\/admin\/channels\/WEB",
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
"checkoutState": "completed",
|
||||
"paymentState": "awaiting_payment",
|
||||
"shippingState": "ready",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"id": "@integer@",
|
||||
"number": "@string@",
|
||||
"notes": null,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Payment",
|
||||
"@id": "\/api\/v2\/admin\/orders\/nAWw2jewpA\/payments",
|
||||
"@id": "\/api\/v2\/admin\/orders\/token\/payments",
|
||||
"@type": "hydra:Collection",
|
||||
"hydra:totalItems": 1,
|
||||
"hydra:member": [
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Shipment",
|
||||
"@id": "\/api\/v2\/admin\/orders\/nAWw2jewpA\/shipments",
|
||||
"@id": "\/api\/v2\/admin\/orders\/token\/shipments",
|
||||
"@type": "hydra:Collection",
|
||||
"hydra:totalItems": 1,
|
||||
"hydra:member": [
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"@context": "\/api\/v2\/contexts\/Payment",
|
||||
"@id": "\/api\/v2\/admin\/payments\/@integer@",
|
||||
"@type": "Payment",
|
||||
"order": "\/api\/v2\/admin\/orders\/nAWw2jewpA",
|
||||
"order": "\/api\/v2\/admin\/orders\/token",
|
||||
"id": "@integer@",
|
||||
"method": {
|
||||
"@id": "\/api\/v2\/admin\/payment-methods\/CASH_ON_DELIVERY",
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
{
|
||||
"@id": "\/api\/v2\/admin\/payments\/@integer@",
|
||||
"@type": "Payment",
|
||||
"order": "\/api\/v2\/admin\/orders\/nAWw2jewpA",
|
||||
"order": "\/api\/v2\/admin\/orders\/token",
|
||||
"id": "@integer@",
|
||||
"method": {
|
||||
"@id": "\/api\/v2\/admin\/payment-methods\/CASH_ON_DELIVERY",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"@context": "\/api\/v2\/contexts\/Payment",
|
||||
"@id": "\/api\/v2\/admin\/payments\/@integer@",
|
||||
"@type": "Payment",
|
||||
"order": "\/api\/v2\/admin\/orders\/nAWw2jewpA",
|
||||
"order": "\/api\/v2\/admin\/orders\/token",
|
||||
"id": "@integer@",
|
||||
"method": {
|
||||
"@id": "\/api\/v2\/admin\/payment-methods\/CASH_ON_DELIVERY",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"@context": "\/api\/v2\/contexts\/Shipment",
|
||||
"@id": "\/api\/v2\/admin\/shipments\/@integer@",
|
||||
"@type": "Shipment",
|
||||
"order": "\/api\/v2\/admin\/orders\/nAWw2jewpA",
|
||||
"order": "\/api\/v2\/admin\/orders\/token",
|
||||
"id": "@integer@",
|
||||
"state": "ready",
|
||||
"method": "\/api\/v2\/admin\/shipping-methods\/UPS",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": null,
|
||||
|
|
@ -28,11 +28,11 @@
|
|||
"checkoutState": "cart",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": null,
|
||||
|
|
@ -28,11 +28,11 @@
|
|||
"checkoutState": "cart",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": null,
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
"checkoutState": "cart",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [],
|
||||
"itemsTotal": 0,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": {
|
||||
|
|
@ -57,11 +57,11 @@
|
|||
"checkoutState": "addressed",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": {
|
||||
|
|
@ -57,11 +57,11 @@
|
|||
"checkoutState": "addressed",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": null,
|
||||
|
|
@ -28,11 +28,11 @@
|
|||
"checkoutState": "cart",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": {
|
||||
|
|
@ -43,11 +43,11 @@
|
|||
"checkoutState": "completed",
|
||||
"paymentState": "paid",
|
||||
"shippingState": "shipped",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": "000000001",
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_NFT_FREE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": {
|
||||
|
|
@ -50,11 +50,11 @@
|
|||
"checkoutState": "completed",
|
||||
"paymentState": "awaiting_payment",
|
||||
"shippingState": "shipped",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": "000000001",
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_NFT",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": {
|
||||
|
|
@ -57,11 +57,11 @@
|
|||
"checkoutState": "completed",
|
||||
"paymentState": "awaiting_payment",
|
||||
"shippingState": "ready",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": "000000001",
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
"subtotal": 6000
|
||||
},
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_NFT",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": {
|
||||
|
|
@ -57,11 +57,11 @@
|
|||
"checkoutState": "payment_selected",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": {
|
||||
|
|
@ -57,11 +57,11 @@
|
|||
"checkoutState": "payment_selected",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"customer": {
|
||||
|
|
@ -57,11 +57,11 @@
|
|||
"checkoutState": "shipping_selected",
|
||||
"paymentState": "cart",
|
||||
"shippingState": "cart",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": null,
|
||||
"items": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/items\/@integer@",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/items\/@integer@",
|
||||
"@type": "OrderItem",
|
||||
"variant": "\/api\/v2\/shop\/product-variants\/MUG_BLUE",
|
||||
"productName": "Mug",
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@
|
|||
"hydra:totalItems": 2,
|
||||
"hydra:member": [
|
||||
{
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token",
|
||||
"@type": "Order",
|
||||
"channel": "\/api\/v2\/shop\/channels\/WEB",
|
||||
"tokenValue": "nAWw2jewpA",
|
||||
"tokenValue": "token",
|
||||
"number": "000000001",
|
||||
"itemsTotal": 6000,
|
||||
"state": "new",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/Order",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA"
|
||||
"@id": "\/api\/v2\/shop\/orders\/token"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"@context": "\/api\/v2\/contexts\/ShippingMethod",
|
||||
"@id": "\/api\/v2\/shop\/orders\/nAWw2jewpA\/shipments\/@integer@\/methods",
|
||||
"@id": "\/api\/v2\/shop\/orders\/token\/shipments\/@integer@\/methods",
|
||||
"@type": "hydra:Collection",
|
||||
"hydra:member": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$this->placeOrder('nAWw2jewpA', 'oliver@doe.com');
|
||||
$this->placeOrder(email: 'oliver@doe.com');
|
||||
$this->placeOrder('nAWw2jewpB', 'oliver@doe.com');
|
||||
$this->placeOrder('nAWw2jewpC', 'dave@doe.com');
|
||||
$this->pickUpCart('nAWw2jewpD');
|
||||
|
|
@ -440,7 +440,7 @@ final class OrdersTest extends JsonApiTestCase
|
|||
/** @var PaymentMethodInterface $paymentMethod */
|
||||
$paymentMethod = $fixtures['payment_method_bank_transfer'];
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
$this->placeOrder($tokenValue, 'oliver@doe.com');
|
||||
$this->cancelOrder($tokenValue);
|
||||
|
||||
|
|
@ -602,7 +602,7 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
$this->placeOrder($tokenValue);
|
||||
|
||||
$this->requestGet(sprintf('/api/v2/shop/orders/%s/payments/%s/configuration', $tokenValue, 'invalid-payment-id'));
|
||||
|
|
@ -622,7 +622,7 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
$this->placeOrder($tokenValue, 'oliver@doe.com');
|
||||
|
||||
$this->requestDelete(
|
||||
|
|
@ -694,10 +694,10 @@ final class OrdersTest extends JsonApiTestCase
|
|||
'payment_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
$this->placeOrder($tokenValue, 'oliver@doe.com');
|
||||
|
||||
$this->client->request('GET', '/api/v2/shop/orders/nAWw2jewpA/adjustments', [], [], self::CONTENT_TYPE_HEADER);
|
||||
$this->client->request('GET', '/api/v2/shop/orders/token/adjustments', [], [], self::CONTENT_TYPE_HEADER);
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
$this->assertResponseCode($response, Response::HTTP_UNAUTHORIZED);
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ final class PaymentMethodsTest extends JsonApiTestCase
|
|||
{
|
||||
$this->loadFixturesFromFiles(['channel/channel.yaml', 'cart.yaml', 'payment_method.yaml']);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
|
||||
/** @var MessageBusInterface $commandBus */
|
||||
$commandBus = self::getContainer()->get('sylius.command_bus');
|
||||
|
|
@ -45,7 +45,7 @@ final class PaymentMethodsTest extends JsonApiTestCase
|
|||
);
|
||||
$commandBus->dispatch($addItemToCartCommand);
|
||||
|
||||
$this->client->request(method: 'GET', uri: '/api/v2/shop/orders/nAWw2jewpA', server: self::CONTENT_TYPE_HEADER);
|
||||
$this->client->request(method: 'GET', uri: '/api/v2/shop/orders/token', server: self::CONTENT_TYPE_HEADER);
|
||||
$orderResponse = json_decode($this->client->getResponse()->getContent(), true);
|
||||
|
||||
$this->client->request(
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ final class ShippingMethodsTest extends JsonApiTestCase
|
|||
{
|
||||
$this->loadFixturesFromFiles(['channel/channel.yaml', 'cart.yaml', 'country.yaml', 'shipping_method.yaml']);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
$this->getCartAndPutItemForCustomer($tokenValue, 'guest@example.com');
|
||||
|
||||
$this->requestGet(sprintf('/api/v2/shop/orders/%s', $tokenValue));
|
||||
|
|
@ -93,7 +93,7 @@ final class ShippingMethodsTest extends JsonApiTestCase
|
|||
'shipping_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
$this->getCartAndPutItemForCustomer($tokenValue, 'oliver@doe.com');
|
||||
|
||||
/** @var ShipmentRepositoryInterface $shipmentRepository */
|
||||
|
|
@ -117,7 +117,7 @@ final class ShippingMethodsTest extends JsonApiTestCase
|
|||
'shipping_method.yaml',
|
||||
]);
|
||||
|
||||
$tokenValue = 'nAWw2jewpA';
|
||||
$tokenValue = 'token';
|
||||
$this->getCartAndPutItemForCustomer($tokenValue, 'oliver@doe.com');
|
||||
|
||||
/** @var ShipmentRepositoryInterface $shipmentRepository */
|
||||
|
|
@ -145,7 +145,7 @@ final class ShippingMethodsTest extends JsonApiTestCase
|
|||
'shipping_method.yaml',
|
||||
]);
|
||||
|
||||
$this->requestGet('/api/v2/shop/orders/nAWw2jewpA/shipments/-10/methods');
|
||||
$this->requestGet('/api/v2/shop/orders/token/shipments/-10/methods');
|
||||
|
||||
$this->assertResponse($this->client->getResponse(), 'shop/shipping_method/get_empty_order_shipping_methods_response');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ trait OrderPlacerTrait
|
|||
return $order;
|
||||
}
|
||||
|
||||
protected function pickUpCart(string $tokenValue = 'nAWw2jewpA', string $channelCode = 'WEB', ?string $email = null, string $localeCode = 'en_US'): string
|
||||
protected function pickUpCart(string $tokenValue = 'token', string $channelCode = 'WEB', ?string $email = null, string $localeCode = 'en_US'): string
|
||||
{
|
||||
$pickupCartCommand = new PickupCart(
|
||||
channelCode: $channelCode,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue