Skip to content
Extraits de code Groupes Projets
Valider b9f59404 rédigé par Matthieu Napoli's avatar Matthieu Napoli
Parcourir les fichiers

Fixing tests

parent d71e9ce1
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -15,24 +15,6 @@ use Piwik\Tests\Fixture; ...@@ -15,24 +15,6 @@ use Piwik\Tests\Fixture;
*/ */
class FrontControllerTest extends \PHPUnit_Framework_TestCase class FrontControllerTest extends \PHPUnit_Framework_TestCase
{ {
/**
* @dataProvider indexUrlsProvider
*/
public function testIndexRedirection($url)
{
$header = $this->getResponseHeader($url);
$url = 'index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday';
$this->assertContains('Location: ' . $url, $header);
}
public function indexUrlsProvider()
{
return array(
array(''),
array('index.php'),
);
}
/** /**
* @dataProvider malformedUrlsProvider * @dataProvider malformedUrlsProvider
*/ */
...@@ -41,7 +23,7 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase ...@@ -41,7 +23,7 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase
$header = $this->getResponseHeader($url); $header = $this->getResponseHeader($url);
if ($redirection) { if ($redirection) {
$this->assertContains('Location: http://localhost:8000/' . $redirection . "\r\n", $header); $this->assertContains('Location: ' . Fixture::getRootUrl() . 'tests/PHPUnit/proxy/' . $redirection . "\r\n", $header);
} else { } else {
$this->assertNotContains('Location: ', $header); $this->assertNotContains('Location: ', $header);
} }
...@@ -72,7 +54,7 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase ...@@ -72,7 +54,7 @@ class FrontControllerTest extends \PHPUnit_Framework_TestCase
} }
$ch = curl_init(); $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, Fixture::getRootUrl() . $url); curl_setopt($ch, CURLOPT_URL, Fixture::getRootUrl() . 'tests/PHPUnit/proxy/' . $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_TIMEOUT, 10);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter