I’m using PHPUnit/WP_UnitTestCase to unit test a WP theme. I need to simulate that I’m on a page with a certain slug, and I’ve been told to use go_to() to do this. However, I can’t figure out how to actually use the function.
If I do something like this, it won’t work:
$this->go_to('test');
$this->assertTrue(is_page('test'));
Any Advice?
The
go_to
function requires a urlhttps://core.trac.wordpress.org/browser/trunk/tests/phpunit/includes/testcase.php#L420