Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fetch table from existing setup method.
  • Loading branch information
joedolson committed Mar 16, 2025
commit 99c6304bdd3199c38e98a246520ff1ae1d5db96e
6 changes: 4 additions & 2 deletions tests/phpunit/tests/admin/wpPostsListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ public function test_get_views_should_return_views_by_default() {
* Tests that column_author() displays the correct author link when an author exists.
*
* @ticket 62913
*
* @covers WP_Posts_List_Table::column_author
*/
public function test_column_author_with_valid_author() {
Expand All @@ -348,7 +349,7 @@ public function test_column_author_with_valid_author() {
$expected_url = esc_url( add_query_arg( array( 'author' => $author_id ), 'upload.php' ) );

ob_start();
self::$list_table->column_author( $post );
$this->table->column_author( $post );
$output = ob_get_clean();

$this->assertStringContainsString( '<a href="' . $expected_url . '">', $output, 'Author column contains author URL' );
Expand All @@ -359,6 +360,7 @@ public function test_column_author_with_valid_author() {
* Tests that column_author() displays the correct fallback when no author exists.
*
* @ticket 62913
*
* @covers WP_Posts_List_Table::column_author
*/
public function test_column_author_with_no_author() {
Expand All @@ -369,7 +371,7 @@ public function test_column_author_with_no_author() {
$post = get_post( $post_id );

ob_start();
self::$list_table->column_author( $post );
$this->table->column_author( $post );
$output = ob_get_clean();

$this->assertStringContainsString( '<span aria-hidden="true">&#8212;</span>', $output, 'Author column with no author shows em dash.' );
Expand Down
Loading