mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 17:10:53 +00:00
[Unit][Orders] Add tests for items quantity change
This commit is contained in:
parent
f9e83a7543
commit
0268c02a7f
1 changed files with 17 additions and 0 deletions
|
|
@ -333,6 +333,23 @@ final class OrdersTest extends JsonApiTestCase
|
|||
);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_returns_unprocessable_entity_status_if_trying_to_change_item_quantity_if_invalid_item_id_passed(): void
|
||||
{
|
||||
$this->loadFixturesFromFiles(['channel.yaml', 'cart.yaml']);
|
||||
|
||||
$tokenValue = $this->pickUpCart();
|
||||
|
||||
$this->client->request(
|
||||
method: 'PATCH',
|
||||
uri: sprintf('/api/v2/shop/orders/%s/items/%s', $tokenValue, 'invalid-item-id'),
|
||||
server: ContentType::APPLICATION_JSON_MERGE_PATCH,
|
||||
content: json_encode(['quantity' => 5])
|
||||
);
|
||||
|
||||
$this->assertResponseCode($this->client->getResponse(), Response::HTTP_UNPROCESSABLE_ENTITY);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_does_not_return_payment_configuration_if_invalid_payment_id_passed(): void
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue