Ticket #47567: 47567.diff
File 47567.diff, 1.2 KB (added by , 4 years ago) |
---|
-
tests/phpunit/includes/spy-rest-server.php
27 27 return call_user_func_array( array( $this, $method ), $args ); 28 28 } 29 29 30 /** 31 * Sets a header that will be send by doing the request. 32 * 33 * @param string $header The header name. 34 * @param string $value THe header value. 35 */ 30 36 public function send_header( $header, $value ) { 31 37 $this->sent_headers[ $header ] = $value; 32 38 } 33 39 40 /** 41 * Unsets a header that will be send. 42 * 43 * @param string $header The header to remove. 44 */ 34 45 public function remove_header( $header ) { 35 46 unset( $this->sent_headers[ $header ] ); 36 47 } … … 60 71 parent::register_route( $namespace, $route, $route_args, $override || $this->override_by_default ); 61 72 } 62 73 74 /** 75 * Serves the request and returns the result. 76 * 77 * @param null|string $path The path to request. 78 * 79 * @return false|null Null if not served and a HEAD request, false otherwise. 80 */ 63 81 public function serve_request( $path = null ) { 64 82 65 83 ob_start();