Changeset 53147 for trunk/tests/phpunit/tests/user/author.php
- Timestamp:
- 04/11/2022 11:36:56 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/user/author.php
r52389 r53147 20 20 'display_name' => 'Test Author', 21 21 'description' => 'test_author', 22 'user_url' => 'http://example.com', 22 23 ) 23 24 ); … … 145 146 } 146 147 148 /** 149 * @ticket 51859 150 * 151 * @covers ::get_the_author_link 152 */ 153 public function test_get_the_author_link() { 154 $author_url = get_the_author_meta( 'url' ); 155 $author_display_name = get_the_author(); 156 157 $link = get_the_author_link(); 158 159 $this->assertStringContainsString( $author_url, $link, 'The link does not contain the author URL' ); 160 $this->assertStringContainsString( $author_display_name, $link, 'The link does not contain the author display name' ); 161 } 162 163 /** 164 * @ticket 51859 165 * 166 * @covers ::get_the_author_link 167 */ 168 public function test_filtered_get_the_author_link() { 169 $filter = new MockAction(); 170 171 add_filter( 'the_author_link', array( &$filter, 'filter' ) ); 172 173 get_the_author_link(); 174 175 $this->assertSame( 1, $filter->get_call_count() ); 176 $this->assertSame( array( 'the_author_link' ), $filter->get_tags() ); 177 } 147 178 }
Note: See TracChangeset
for help on using the changeset viewer.