Intégration reservations et mock lavage

This commit is contained in:
bastien
2026-07-03 19:01:49 +02:00
parent b2443b654c
commit 55a558b536
16 changed files with 346 additions and 5 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature\Api;
use Tests\TestCase;
class CorsTest extends TestCase
{
public function test_preflight_options_on_api_returns_cors_headers(): void
{
$response = $this->call(
'OPTIONS',
'/api/v1/health',
server: [
'HTTP_ORIGIN' => 'http://localhost:5173',
'HTTP_ACCESS_CONTROL_REQUEST_METHOD' => 'GET',
'HTTP_ACCESS_CONTROL_REQUEST_HEADERS' => 'Authorization, Content-Type',
],
);
$response->assertOk();
$response->assertHeader('Access-Control-Allow-Origin', '*');
$response->assertHeader('Access-Control-Allow-Methods');
}
public function test_get_request_includes_cors_headers_for_browser_origin(): void
{
$response = $this->getJson('/api/v1/health', [
'Origin' => 'http://localhost:5173',
]);
$response->assertOk();
$response->assertHeader('Access-Control-Allow-Origin', '*');
}
}