futtern/tests/Feature/Api/ApiSmokeTest.php
lubiana b00b923d43
All checks were successful
/ ls (pull_request) Successful in 1m30s
/ ls (push) Successful in 1m28s
/ ls (release) Successful in 1m1s
add simple apitest
2025-02-06 20:35:49 +01:00

15 lines
555 B
PHP

<?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);
});