Unit testing to simulate the loop

The key for that is the go_to method of WP_UnitTestCase class that you should be extending. It simulates parsing a url relative to the wordpress root (IIRC). You might need to first set posts and other info, and then call go_to to trigger the loop.

Leave a Comment