Skip to content
Extraits de code Groupes Projets
Valider b921a479 rédigé par diosmosis's avatar diosmosis
Parcourir les fichiers

Only use localhost in HttpTest test.

parent 0224f363
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -33,8 +33,8 @@ class HttpTest extends PHPUnit_Framework_TestCase ...@@ -33,8 +33,8 @@ class HttpTest extends PHPUnit_Framework_TestCase
public function testFetchRemoteFile($method) public function testFetchRemoteFile($method)
{ {
$this->assertNotNull(Http::getTransportMethod()); $this->assertNotNull(Http::getTransportMethod());
$version = Http::sendHttpRequestBy($method, 'http://api.piwik.org/1.0/getLatestVersion/', 30); $result = Http::sendHttpRequestBy($method, 'http://localhost/', 30);
$this->assertTrue((boolean)preg_match('/^([0-9.]+)$/', $version)); $this->assertTrue(strpos($result, 'Piwik') !== false);
} }
/** /**
...@@ -43,7 +43,7 @@ class HttpTest extends PHPUnit_Framework_TestCase ...@@ -43,7 +43,7 @@ class HttpTest extends PHPUnit_Framework_TestCase
public function testFetchApiLatestVersion() public function testFetchApiLatestVersion()
{ {
$destinationPath = PIWIK_USER_PATH . '/tmp/latest/LATEST'; $destinationPath = PIWIK_USER_PATH . '/tmp/latest/LATEST';
Http::fetchRemoteFile('http://api.piwik.org/1.0/getLatestVersion/', $destinationPath, 3); Http::fetchRemoteFile('http://localhost/', $destinationPath, 3);
$this->assertFileExists($destinationPath); $this->assertFileExists($destinationPath);
$this->assertGreaterThan(0, filesize($destinationPath)); $this->assertGreaterThan(0, filesize($destinationPath));
} }
...@@ -54,7 +54,7 @@ class HttpTest extends PHPUnit_Framework_TestCase ...@@ -54,7 +54,7 @@ class HttpTest extends PHPUnit_Framework_TestCase
public function testFetchLatestZip() public function testFetchLatestZip()
{ {
$destinationPath = PIWIK_USER_PATH . '/tmp/latest/latest.zip'; $destinationPath = PIWIK_USER_PATH . '/tmp/latest/latest.zip';
Http::fetchRemoteFile('http://builds.piwik.org/latest.zip', $destinationPath, 3, 30); Http::fetchRemoteFile('http://localhost/tests/PHPUnit/Core/Unzip/relative.zip', $destinationPath, 3, 30);
$this->assertFileExists($destinationPath); $this->assertFileExists($destinationPath);
$this->assertGreaterThan(0, filesize($destinationPath)); $this->assertGreaterThan(0, filesize($destinationPath));
} }
...@@ -100,7 +100,7 @@ class HttpTest extends PHPUnit_Framework_TestCase ...@@ -100,7 +100,7 @@ class HttpTest extends PHPUnit_Framework_TestCase
$result = Http::sendHttpRequestBy( $result = Http::sendHttpRequestBy(
$method, $method,
'http://builds.piwik.org/latest.zip', 'http://localhost/tests/PHPUnit/Core/Unzip/relative.zip',
30, 30,
$userAgent = null, $userAgent = null,
$destinationPath = null, $destinationPath = null,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter