Changeset 49932 for trunk/tests/phpunit/tests/user/author.php
- Timestamp:
- 01/04/2021 11:32:49 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/author.php
r48937 r49932 16 16 self::$author_id = $factory->user->create( 17 17 array( 18 'role' => 'author', 19 'user_login' => 'test_author', 20 'description' => 'test_author', 18 'role' => 'author', 19 'user_login' => 'test_author', 20 'display_name' => 'Test Author', 21 'description' => 'test_author', 21 22 ) 22 23 ); … … 49 50 50 51 $this->assertSame( $user->display_name, $author_name ); 51 $this->assertSame( ' test_author', $author_name );52 $this->assertSame( 'Test Author', $author_name ); 52 53 } 53 54 … … 55 56 $this->assertSame( 'test_author', get_the_author_meta( 'login' ) ); 56 57 $this->assertSame( 'test_author', get_the_author_meta( 'user_login' ) ); 57 $this->assertSame( ' test_author', get_the_author_meta( 'display_name' ) );58 $this->assertSame( 'Test Author', get_the_author_meta( 'display_name' ) ); 58 59 59 60 $this->assertSame( 'test_author', trim( get_the_author_meta( 'description' ) ) ); … … 111 112 */ 112 113 public function test_get_the_author_posts_link_no_permalinks() { 113 $author = self::factory()->user->create_and_get( 114 array( 115 'display_name' => 'Foo', 116 'user_nicename' => 'bar', 117 ) 118 ); 114 $author = get_userdata( self::$author_id ); 119 115 120 116 $GLOBALS['authordata'] = $author->data; … … 125 121 126 122 $this->assertContains( $url, $link ); 127 $this->assertContains( 'Posts by Foo', $link );128 $this->assertContains( '> Foo</a>', $link );123 $this->assertContains( 'Posts by Test Author', $link ); 124 $this->assertContains( '>Test Author</a>', $link ); 129 125 130 126 unset( $GLOBALS['authordata'] ); … … 137 133 $this->set_permalink_structure( '/%postname%/' ); 138 134 139 $author = self::factory()->user->create_and_get( 140 array( 141 'display_name' => 'Foo', 142 'user_nicename' => 'bar', 143 ) 144 ); 135 $author = get_userdata( self::$author_id ); 145 136 146 137 $GLOBALS['authordata'] = $author; … … 153 144 154 145 $this->assertContains( $url, $link ); 155 $this->assertContains( 'Posts by Foo', $link );156 $this->assertContains( '> Foo</a>', $link );146 $this->assertContains( 'Posts by Test Author', $link ); 147 $this->assertContains( '>Test Author</a>', $link ); 157 148 158 149 unset( $GLOBALS['authordata'] );
Note: See TracChangeset
for help on using the changeset viewer.