How to Use WP_UnitTestCase go_to() to Simulate Current Page

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:

Read More
$this->go_to('test');
$this->assertTrue(is_page('test'));

Any Advice?

Related posts

1 comment

Comments are closed.