Mock a WP_REST_Request Object

Viewed 534

I'm currently running some unit tests on a WordPress plug-in, using PHPUnit and WP_Mock (without connecting to WordPress database). As the title states, I need to mock a WP_REST_Request Object, to give it as a parameter to a method under test.

Maybe I could do it by mocking the return of the URL used by the WP_REST_Request::from_url() method, or maybe with the use of getMockFromWsdl(). I'm open to every kind of ideas

1 Answers
Related