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

Add test to check that Https requests fail for a website with an invalid certificate.

We are using divezone.net because @mattab says that he will never fix the broken certificate. If this test ever fails in the future, go after him :p
parent 957693ec
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -116,14 +116,19 @@ class HttpTest extends \PHPUnit_Framework_TestCase
$this->assertTrue(in_array($result['headers']['Content-Type'], array('application/zip', 'application/x-zip-compressed')));
}
public function testHttps()
public function testHttpsWorksWithValidCertificate()
{
$result = Http::sendHttpRequestBy(
'curl',
'https://builds.piwik.org/LATEST',
10
);
$result = Http::sendHttpRequestBy('curl', 'https://builds.piwik.org/LATEST', 10);
$this->assertStringMatchesFormat('%d.%d.%d', $result);
}
/**
* @expectedException \Exception
* @expectedExceptionMessage curl_exec: SSL certificate problem: Invalid certificate chain.
*/
public function testHttpsFailsWithInvalidCertificate()
{
Http::sendHttpRequestBy('curl', 'https://divezone.net', 10);
}
}
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