/** * @covers WPSEO_Frontend::is_home_static_page */ public function test_is_home_static_page() { // on front page $this->go_to_home(); $this->assertFalse(self::$class_instance->is_home_static_page()); // on front page and show_on_front = page update_option('show_on_front', 'page'); $this->assertFalse(self::$class_instance->is_home_static_page()); // create page and set it as front page $post_id = $this->factory->post->create(array('post_type' => 'page')); update_option('page_on_front', $post_id); $this->go_to(get_permalink($post_id)); // on front page, show_on_front = page and on static page $this->assertTrue(self::$class_instance->is_home_static_page()); // go to differen post but preserve previous options $post_id = $this->factory->post->create(); $this->go_to(get_permalink($post_id)); // options set but not on front page, should return false $this->assertFalse(self::$class_instance->is_home_static_page()); }