Skip to content

Commit 1614444

Browse files
committed
Fix hooks processing in cURL tests
1 parent a9e191a commit 1614444

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/Transport/CurlTest.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,17 @@ protected function getOptions($other = array()) {
3434

3535
$this->curl_handle = null;
3636

37-
$hooks = new Hooks();
38-
$hooks->register(
37+
if (!array_key_exists('hooks', $options)) {
38+
$options['hooks'] = new Hooks();
39+
}
40+
41+
$options['hooks']->register(
3942
'curl.before_request',
4043
function ($handle) {
4144
$this->curl_handle = $handle;
4245
}
4346
);
4447

45-
$options['hooks'] = $hooks;
46-
4748
return $options;
4849
}
4950

0 commit comments

Comments
 (0)