コード例 #1
0
 /**
  * @covers WPSEO_Frontend::get_author_title
  */
 public function test_get_author_title()
 {
     // create and go to author
     $user_id = $this->factory->user->create();
     $this->go_to(get_author_posts_url($user_id));
     // test general author title
     $expected_title = self::$class_instance->get_title_from_options('title-author-wpseo');
     $this->assertEquals($expected_title, self::$class_instance->get_author_title());
     // add explicit title to author meta
     $explicit_title = 'WPSEO Author Title %%sitename%%';
     add_user_meta($user_id, 'wpseo_title', $explicit_title);
     // test explicit title
     $expected_title = wpseo_replace_vars('WPSEO Author Title %%sitename%%', array());
     $this->assertEquals($expected_title, self::$class_instance->get_author_title());
 }