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
Provide message arg in tests with multiple methods
  • Loading branch information
joedolson committed Mar 16, 2025
commit d9560014b938309741aede9568c755852e4c1b3b
10 changes: 5 additions & 5 deletions tests/phpunit/tests/admin/wpPostsListTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ public function test_column_author_with_valid_author() {
self::$list_table->column_author( $post );
$output = ob_get_clean();

$this->assertStringContainsString( '<a href="' . $expected_url . '">', $output );
$this->assertStringContainsString( '>' . esc_html( $author_name ) . '</a>', $output );
$this->assertStringContainsString( '<a href="' . $expected_url . '">', $output, 'Author column contains author URL' );
$this->assertStringContainsString( '>' . esc_html( $author_name ) . '</a>', $output, 'Author column contains linked author name.' );
}

/**
Expand All @@ -372,8 +372,8 @@ public function test_column_author_with_no_author() {
self::$list_table->column_author( $post );
$output = ob_get_clean();

$this->assertStringContainsString( '<span aria-hidden="true">&#8212;</span>', $output );
$this->assertStringContainsString( '<span class="screen-reader-text">(no author)</span>', $output );
$this->assertStringNotContainsString( '<a href="', $output );
$this->assertStringContainsString( '<span aria-hidden="true">&#8212;</span>', $output, 'Author column with no author shows em dash.' );
$this->assertStringContainsString( '<span class="screen-reader-text">(no author)</span>', $output, 'Author column with no author contains screen reader text.' );
$this->assertStringNotContainsString( '<a href="', $output, 'Author column with no author does not contain link.' );
}
}