diff options
Diffstat (limited to 'tests/PHPUnit')
-rw-r--r-- | tests/PHPUnit/Integration/Http/AdditionalHeaders.php | 7 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/HttpTest.php | 27 |
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/PHPUnit/Integration/Http/AdditionalHeaders.php b/tests/PHPUnit/Integration/Http/AdditionalHeaders.php new file mode 100644 index 0000000000..88dd746048 --- /dev/null +++ b/tests/PHPUnit/Integration/Http/AdditionalHeaders.php @@ -0,0 +1,7 @@ +<?php + +// used in integration tests to see if additional header works. + +echo $_SERVER['HTTP_CUSTOMHEADER']; + +exit; diff --git a/tests/PHPUnit/Integration/HttpTest.php b/tests/PHPUnit/Integration/HttpTest.php index 1fdec7b6ed..371ad82459 100644 --- a/tests/PHPUnit/Integration/HttpTest.php +++ b/tests/PHPUnit/Integration/HttpTest.php @@ -229,6 +229,33 @@ class HttpTest extends \PHPUnit_Framework_TestCase /** * @dataProvider getMethodsToTest */ + public function testHttpCustomHeaders($method) + { + $result = Http::sendHttpRequestBy( + $method, + Fixture::getRootUrl() . 'tests/PHPUnit/Integration/Http/AdditionalHeaders.php', + 30, + $userAgent = null, + $destinationPath = null, + $file = null, + $followDepth = 0, + $acceptLanguage = false, + $acceptInvalidSslCertificate = false, + $byteRange = false, + $getExtendedInfo = false, + $httpMethod = 'POST', + $httpUsername = '', + $httpPassword = '', + array(), + array('CustomHeader: customdata') + ); + + $this->assertEquals('customdata', $result); + } + + /** + * @dataProvider getMethodsToTest + */ public function testHttpsWorksWithValidCertificate($method) { $result = Http::sendHttpRequestBy($method, 'https://builds.piwik.org/LATEST', 10); |