Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class SampleTest extends WP_UnitTestCase {
- protected function setup_postdata()
- {
- global $post;
- global $wp_query;
- $wp_query->is_singular = true;
- $post_id = $this->factory->post->create( array(
- 'post_title' => 'Hello',
- 'post_author' => 1,
- 'post_status' => 'publish',
- 'post_date' => '2014-01-01 00:00:00',
- ) );
- $post = get_post( $post_id );
- setup_postdata( $post );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement