I'm testing my code, and i have some problem with header. In each api i use
$headers = getallheaders();
to get that, and this works fine when i test with the app or crhome postman extension. When i lauch my test, like this
$client = $this->createClient();
$client->request('GET', '/api/shotcard',
['qrcode'=>'D0m1c173'], [],
['HTTP_API_TOKEN' => 'abc123']
);
$this->assertEquals(200, $client->getResponse()->getStatusCode());
where i try to shot a card with that qrcode with a user with that test token (not the token i'll use in the application), i see a call like this here: https://stackoverflow.com/a/11681422/5475228 . The test fails in this way:
PHP Fatal error: Call to undefined function AppBackendBundle\Controller\getallheaders() in /var/www/pitstop/src/AppBackendBundle/Controller/ApiController.php on line 42