Changeset 35773 for trunk/tests/phpunit/includes/spy-rest-server.php
- Timestamp:
- 12/04/2015 11:35:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/includes/spy-rest-server.php
r34928 r35773 2 2 3 3 class Spy_REST_Server extends WP_REST_Server { 4 5 public $sent_headers = array(); 6 public $sent_body = ''; 7 4 8 /** 5 9 * Get the raw $endpoints data from the server … … 21 25 return call_user_func_array( array( $this, $method ), $args ); 22 26 } 27 28 public function send_header( $header, $value ) { 29 $this->sent_headers[ $header ] = $value; 30 } 31 32 public function serve_request( $path = null ) { 33 34 ob_start(); 35 $result = parent::serve_request( $path ); 36 $this->sent_body = ob_get_clean(); 37 return $result; 38 } 23 39 }
Note: See TracChangeset
for help on using the changeset viewer.