mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-60161 filelib: Unit test for duplicate curl headers.
This commit is contained in:
parent
7d4a3d1d07
commit
01957f1a69
@ -501,6 +501,21 @@ class core_filelib_testcase extends advanced_testcase {
|
||||
$CFG->proxybypass = $oldproxybypass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that duplicate lines in the curl header are removed.
|
||||
*/
|
||||
public function test_duplicate_curl_header() {
|
||||
$testurl = $this->getExternalTestFileUrl('/test_post.php');
|
||||
|
||||
$curl = new curl();
|
||||
$headerdata = 'Accept: application/json';
|
||||
$header = [$headerdata, $headerdata];
|
||||
$this->assertCount(2, $header);
|
||||
$curl->setHeader($header);
|
||||
$this->assertCount(1, $curl->header);
|
||||
$this->assertEquals($headerdata, $curl->header[0]);
|
||||
}
|
||||
|
||||
public function test_curl_post() {
|
||||
$testurl = $this->getExternalTestFileUrl('/test_post.php');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user