diff --git a/tests/PHPUnit/Integration/HttpTest.php b/tests/PHPUnit/Integration/HttpTest.php index bd969991003e41fd64f8e6d0de76a2e92c7a3a9e..05e0acf914eee258e1c1e7878e0c443390b6bef3 100644 --- a/tests/PHPUnit/Integration/HttpTest.php +++ b/tests/PHPUnit/Integration/HttpTest.php @@ -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); + } }