From 85e5cfb2fc5dabec712954566bdb63d8f1e30671 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Wed, 24 May 2017 21:52:10 +0200 Subject: Allow setting custom headers for requests done by Http::sendHttpRequestBy (#11738) --- .../PHPUnit/Integration/Http/AdditionalHeaders.php | 7 ++++++ tests/PHPUnit/Integration/HttpTest.php | 27 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/PHPUnit/Integration/Http/AdditionalHeaders.php (limited to 'tests/PHPUnit') 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 @@ +assertEquals('{"adf2":"44","afc23":"ab12","method":"post"}', $result); } + /** + * @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 */ -- cgit v1.2.3