add simple apitest
This commit is contained in:
parent
d92a63fd7d
commit
b00b923d43
13 changed files with 349 additions and 8 deletions
15
tests/Feature/Api/ApiSmokeTest.php
Normal file
15
tests/Feature/Api/ApiSmokeTest.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php declare(strict_types=1);
|
||||
|
||||
test('orders', function (): void {
|
||||
$response = $this->client->request('GET', '/api/food_orders');
|
||||
$this->assertResponseIsSuccessful();
|
||||
$this->assertResponseHeaderSame('content-type', 'application/ld+json; charset=utf-8');
|
||||
$this->assertJsonContains([
|
||||
'@context' => '/api/contexts/FoodOrder',
|
||||
'@id' => '/api/food_orders',
|
||||
'@type' => 'Collection',
|
||||
'totalItems' => 1,
|
||||
]);
|
||||
$array = $response->toArray();
|
||||
expect($array['member'][0]['orderItems'])->toHaveCount(10);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue