Make WordPress Core

source: trunk/tests/phpunit/includes/spy-rest-server.php @ 34928

Last change on this file since 34928 was 34928, checked in by rmccue, 10 years ago

REST API: Introduce baby API to the world.

Baby API was born at 2.8KLOC on October 8th at 2:30 UTC. API has lots
of growing to do, so wish it the best of luck.

Thanks to everyone who helped along the way:

Props rmccue, rachelbaker, danielbachhuber, joehoyle, drewapicture,
adamsilverstein, netweb, tlovett1, shelob9, kadamwhite, pento,
westonruter, nikv, tobych, redsweater, alecuf, pollyplummer, hurtige,
bpetty, oso96_2000, ericlewis, wonderboymusic, joshkadis, mordauk,
jdgrimes, johnbillion, jeremyfelt, thiago-negri, jdolan, pkevan,
iseulde, thenbrent, maxcutler, kwight, markoheijnen, phh, natewr,
jjeaton, shprink, mattheu, quasel, jmusal, codebykat, hubdotcom,
tapsboy, QWp6t, pushred, jaredcobb, justinsainton, japh, matrixik,
jorbin, frozzare, codfish, michael-arestad, kellbot, ironpaperweight,
simonlampen, alisspers, eliorivero, davidbhayes, JohnDittmar, dimadin,
traversal, cmmarslender, Toddses, kokarn, welcher, and ericpedia.

Fixes #33982.

File size: 497 bytes
Line 
1<?php
2
3class Spy_REST_Server extends WP_REST_Server {
4        /**
5         * Get the raw $endpoints data from the server
6         *
7         * @return array
8         */
9        public function get_raw_endpoint_data() {
10                return $this->endpoints;
11        }
12
13        /**
14         * Allow calling protected methods from tests
15         *
16         * @param string $method Method to call
17         * @param array $args Arguments to pass to the method
18         * @return mixed
19         */
20        public function __call( $method, $args ) {
21                return call_user_func_array( array( $this, $method ), $args );
22        }
23}
Note: See TracBrowser for help on using the repository browser.