/** * Get the singleton instance of this class * * @return object */ public static function get_instance() { if (!self::$instance instanceof self) { self::$instance = new self(); } return self::$instance; }
/** * @covers WPSEO_GooglePlus::description */ public function test_description() { self::$class_instance->description(); $this->expectOutput(''); // create and go to post $post_id = $this->factory->post->create(); $this->go_to(get_permalink($post_id)); // should be empty, didn't set google-plus-description self::$class_instance->description(); $this->expectOutput(''); // set meta $description = 'Google description'; WPSEO_Meta::set_value('google-plus-description', $description, $post_id); // test output $expected = '<meta itemprop="description" content="' . $description . '">' . "\n"; self::$class_instance->description(); $this->expectOutput($expected); }