Closed
Description
I have a stateless API endpoint:
security:
firewalls:
api:
pattern: ^/api/
stateless: true
anonymous: true
http_basic:
realm: "API Hello"
provider: api_provider
When I do calls on this API, everything work as expected, no cookies.
But when testing, this fails:
There was 1 failure:
1) AppBundle\Tests\Controller\Api\AuthenticationTest::testApiNoCookie
API should not set any cookie!
Failed asserting that actual size 1 matches expected size 0.
public function testApiNoCookie()
{
$this->client->request('GET', '/api/');
$this->assertResponseStatus(Response::HTTP_OK);
$this->assertCount(0, $this->client->getResponse()->headers->getCookies(), 'API should not set any cookie!');
}
The issue does not exist in 3.0