Skip to content

Commit

Permalink
api: use a correct preflight request in RootTest
Browse files Browse the repository at this point in the history
This seems now to be necessary after the upgrade of api-platform.
see api-platform/core#6455
  • Loading branch information
BacLuc committed Jul 21, 2024
1 parent e6542bb commit 36dfdb6
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion api/tests/Api/RootTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@ class RootTest extends ECampApiTestCase {
* @throws ClientExceptionInterface
*/
public function testOptionsWhenNotLoggedIn() {
static::createBasicClient()->request('OPTIONS', '/');
static::createBasicClient()->request(
'OPTIONS',
'/',
[
'headers' => [
'Origin' => 'http://localhost:3000',
'Access-Control-Request-Method' => 'GET',
'Access-Control-Request-Headers' => 'Origin, Content-Type, Accept, Authorization',
],
]
);
$this->assertResponseStatusCodeSame(200);
}
}

0 comments on commit 36dfdb6

Please sign in to comment.