I am trying to write a very basic phpunit test for an application which has a frontend powered by Kohana, and an admin panel powered by Symfony.
My test (which is in our Symfony bundle, and I run using the command line from Symfony's tutorial: bin\phpunit -c app src/****/****Bundle/Tests/Controller/UserControllerTest.php
) looks like this so far:
$client = static::createClient();
$client->setServerParameter('HTTP_HOST', 'www.local');
$crawler = $client->request('GET', '/');
var_dump($crawler);
var_dump($client->getResponse()->getContent());
When I go to http://www.local
in my browser, I see our application. But the var_dump
of the content shows:
string(388) "<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="refresh" content="1;url=http://www.local/login" />
<title>Redirecting to http://ift.tt/1AnXPul;
</head>
<body>
Redirecting to <a href="http://www.local/login">http://ift.tt/16f9MFN;.
</body>
</html>"
I have no idea where to proceed from here to debug this, so please be gentle :)
Aucun commentaire:
Enregistrer un commentaire