Skip to content

Commit 00bec6c

Browse files
committed
Add hook to http_request() util
Facilitates HTTP request mocking in tests
1 parent 78fb639 commit 00bec6c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

php/utils.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,8 @@ function http_request( $method, $url, $data = null, $headers = [], $options = []
830830
$options['verify'] = ! empty( ini_get( 'curl.cainfo' ) ) ? ini_get( 'curl.cainfo' ) : true;
831831
}
832832

833+
$options = WP_CLI::do_hook( 'http_request_options', $options );
834+
833835
RequestsLibrary::register_autoloader();
834836

835837
$request_method = [ RequestsLibrary::get_class_name(), 'request' ];

0 commit comments

Comments
 (0)