-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor #15922 [Unit][Admin] Missing Payments Tests (Rafikooo)
This PR was merged into the 1.13 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.13 <!-- see the comment below --> | | Bug fix? | no | | New feature? | no | | BC breaks? | no | | Deprecations? | no<!-- don't forget to update the UPGRADE-*.md file --> | | License | MIT | <!-- - Bug fixes must be submitted against the 1.12 branch - Features and deprecations must be submitted against the 1.13 branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> Commits ------- [Unit][Admin] Add a payment completion test [Unit] Add requestPatch method to utils functions [Unit][Admin] Add another payment completion test [Unit][Admin] Add payments filtering by payment state test [ECS] Apply ecs fixes
- Loading branch information
Showing
10 changed files
with
233 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
tests/Api/Responses/admin/payment/get_payments_filtered_by_state_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"@context": "\/api\/v2\/contexts\/Payment", | ||
"@id": "\/api\/v2\/admin\/payments", | ||
"@type": "hydra:Collection", | ||
"hydra:member": [ | ||
{ | ||
"@id": "\/api\/v2\/admin\/payments\/@integer@", | ||
"@type": "Payment", | ||
"order": "\/api\/v2\/admin\/orders\/unpaidOrder", | ||
"id": @integer@, | ||
"method": { | ||
"@id": "\/api\/v2\/admin\/payment-methods\/CASH_ON_DELIVERY", | ||
"@type": "PaymentMethod", | ||
"translations": { | ||
"en_US": { | ||
"@id": "\/api\/v2\/admin\/payment-method-translations\/@integer@", | ||
"@type": "PaymentMethodTranslation", | ||
"name": "Cash on delivery" | ||
} | ||
} | ||
}, | ||
"currencyCode": "USD", | ||
"amount": 6500, | ||
"state": "new", | ||
"details": [], | ||
"createdAt": @datetime@, | ||
"updatedAt": @datetime@ | ||
} | ||
], | ||
"hydra:totalItems": 1, | ||
"hydra:view": { | ||
"@id": "\/api\/v2\/admin\/payments?state=new", | ||
"@type": "hydra:PartialCollectionView" | ||
}, | ||
"hydra:search": { | ||
"@type": "hydra:IriTemplate", | ||
"hydra:template": "\/api\/v2\/admin\/payments{?state,state[],order.channel.code,order.channel.code[]}", | ||
"hydra:variableRepresentation": "BasicRepresentation", | ||
"hydra:mapping": [ | ||
{ | ||
"@type": "IriTemplateMapping", | ||
"variable": "state", | ||
"property": "state", | ||
"required": false | ||
}, | ||
{ | ||
"@type": "IriTemplateMapping", | ||
"variable": "state[]", | ||
"property": "state", | ||
"required": false | ||
}, | ||
{ | ||
"@type": "IriTemplateMapping", | ||
"variable": "order.channel.code", | ||
"property": "order.channel.code", | ||
"required": false | ||
}, | ||
{ | ||
"@type": "IriTemplateMapping", | ||
"variable": "order.channel.code[]", | ||
"property": "order.channel.code", | ||
"required": false | ||
} | ||
] | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
tests/Api/Responses/admin/payment/patch_complete_payment_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"@context": "\/api\/v2\/contexts\/Payment", | ||
"@id": "\/api\/v2\/admin\/payments\/@integer@", | ||
"@type": "Payment", | ||
"order": "\/api\/v2\/admin\/orders\/nAWw2jewpA", | ||
"id": @integer@, | ||
"method": "\/api\/v2\/admin\/payment-methods\/CASH_ON_DELIVERY", | ||
"currencyCode": "USD", | ||
"amount": 6500, | ||
"state": "completed", | ||
"details": [], | ||
"createdAt": @string@, | ||
"updatedAt": @string@ | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/Api/Responses/admin/payment/patch_not_complete_payment_response.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"@context": "\/api\/v2\/contexts\/Error", | ||
"@type": "hydra:Error", | ||
"hydra:title": "An error occurred", | ||
"hydra:description": "Cannot complete the payment." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.