function testNextWithDraft() { $posts = array(); for ($i = 0; $i < 2; $i++) { $posts[] = $this->factory->post->create(); sleep(1); } $firstPost = new TimberPost($posts[0]); $nextPost = new TimberPost($posts[1]); $nextPost->post_status = 'draft'; wp_update_post($nextPost); $nextPostTest = $firstPost->next(); print_r($nextPostTest); }
function testNextWithDraft() { $posts = array(); for ($i = 0; $i < 2; $i++) { $j = $i + 1; $posts[] = $this->factory->post->create(array('post_date' => '2014-02-0' . $j . ' 12:00:00')); } $firstPost = new TimberPost($posts[0]); $nextPost = new TimberPost($posts[1]); $nextPost->post_status = 'draft'; wp_update_post($nextPost); $nextPostTest = $firstPost->next(); }
public function next($in_same_cat = false) { return $this->post->next($in_same_cat); }