fixie
All checks were successful
/ ls (pull_request) Successful in 1m33s
/ ls (push) Successful in 1m28s
/ ls (release) Successful in 1m0s

This commit is contained in:
lubiana 2025-06-18 16:56:49 +02:00
parent 300c8cafc9
commit 6bb49e8f79
Signed by: lubiana
SSH key fingerprint: SHA256:vW1EA0fRR3Fw+dD/sM0K+x3Il2gSry6YRYHqOeQwrfk
6 changed files with 26 additions and 33 deletions

View file

@ -230,31 +230,6 @@ describe(FoodOrderController::class, function (): void {
$openOrder = $this->repository->find($order->getId());
$this->assertTrue($openOrder->isClosed());
});
test('api_latest_order', function (): void {
// Create an older order
$olderOrder = new FoodOrder($this->generateOldUlid());
$olderOrder->setFoodVendor($this->vendor);
$this->manager->persist($olderOrder);
// Create the latest order
$latestOrder = new FoodOrder;
$latestOrder->setFoodVendor($this->vendor);
$this->manager->persist($latestOrder);
$this->manager->flush();
// Test the API endpoint
$this->client->request('GET', '/api/food_orders/latest');
$this->assertResponseIsSuccessful();
$this->assertResponseHeaderSame('Content-Type', 'application/ld+json; charset=utf-8');
$response = json_decode($this->client->getResponse()->getContent(), true);
$this->assertIsArray($response);
$this->assertArrayHasKey('@id', $response);
$this->assertStringContainsString($latestOrder->getId()->__toString(), $response['@id']);
});
})
->covers(
FoodOrderController::class,