Hi, I am using phpunit for testing and Symfony \ Bundle \ FrameworkBundle \ Test \ WebTestCase for unit testing. So far there have been no problems, but now we are starting to use https and my tests no longer work. I am starting to get a 301 response code for each of my requests in my tests. My question is how can I pass the request https : //localhost.com/uri instead of http : //localhost.com/uri to the Symfony \ Component \ HttpKernel \ Client?
EDIT
At the symfony website http://symfony.com/doc/current/book/testing.html they show how to configure server settings and there is code similar to
$client->request( 'GET', '/demo/hello/Fabien', array(), array(), array( 'CONTENT_TYPE' => 'application/json', 'HTTP_REFERER' => '/foo/bar', 'HTTP_X-Requested-With' => 'XMLHttpRequest', ) );
I tried to specify an HTTPS element as indicated in http://php.net/manual/en/reserved.variables.server.php changed my code as
$client->request('GET', '/'.$version.'/agencies/'.$agencyId, array(), array(), array('HTTPS' => 'on') );
However, it still does not work?
Omer temel
source share