Make WordPress Core

Ticket #47567: 47567.diff

File 47567.diff, 1.2 KB (added by andizer, 5 years ago)
  • tests/phpunit/includes/spy-rest-server.php

     
    2727                return call_user_func_array( array( $this, $method ), $args );
    2828        }
    2929
     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         */
    3036        public function send_header( $header, $value ) {
    3137                $this->sent_headers[ $header ] = $value;
    3238        }
    3339
     40        /**
     41         * Unsets a header that will be send.
     42         *
     43         * @param string $header The header to remove.
     44         */
    3445        public function remove_header( $header ) {
    3546                unset( $this->sent_headers[ $header ] );
    3647        }
     
    6071                parent::register_route( $namespace, $route, $route_args, $override || $this->override_by_default );
    6172        }
    6273
     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         */
    6381        public function serve_request( $path = null ) {
    6482
    6583                ob_start();