How to setup a mocked WP_Query in a WP_UnitTestCase

How do I setup a mock global $wp_query for a unit test?

I basically want to setup the query so that is_single returns true.

Read More

Stubbing over the function with namespaces is not an option since it clobbers the function for all remaining tests.

Related posts

Leave a Reply

1 comment