Skip to content

Commit 9bfdd79

Browse files
committed
Remove keys not found in curl_getinfo() response on select systems
1 parent ed37de7 commit 9bfdd79

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/PHPCurlClass/PHPCurlClassTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3037,6 +3037,22 @@ public function testGetInfo()
30373037
'request_header',
30383038
);
30393039

3040+
// Not all keys are included on PHP 5.3 (tested 5.3.29).
3041+
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
3042+
foreach (array('primary_ip', 'primary_port', 'local_ip', 'local_port') as $value) {
3043+
$key = array_search($value, $expected_keys);
3044+
unset($expected_keys[$key]);
3045+
}
3046+
}
3047+
3048+
// Not all keys are included on HHVM (tested 3.6.6).
3049+
if (defined('HHVM_VERSION')) {
3050+
foreach (array('certinfo', 'primary_ip', 'primary_port', 'local_ip', 'redirect_url') as $value) {
3051+
$key = array_search($value, $expected_keys);
3052+
unset($expected_keys[$key]);
3053+
}
3054+
}
3055+
30403056
foreach ($expected_keys as $key) {
30413057
$this->assertArrayHasKey($key, $info);
30423058
}

0 commit comments

Comments
 (0)