Skip to content

HTML API: Use assertEqualHTML() in post filtering tests. #9258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
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
10 changes: 5 additions & 5 deletions tests/phpunit/tests/post/filtering.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function test_post_content_unknown_tag() {
$id = self::factory()->post->create( array( 'post_content' => $content ) );
$post = get_post( $id );

$this->assertSame( $expected, $post->post_content );
$this->assertEqualHTML( $expected, $post->post_content );
}

// A simple test to make sure unbalanced tags are fixed.
Expand All @@ -52,7 +52,7 @@ public function test_post_content_unbalanced_tag() {
$id = self::factory()->post->create( array( 'post_content' => $content ) );
$post = get_post( $id );

$this->assertSame( $expected, $post->post_content );
$this->assertEqualHTML( $expected, $post->post_content );
}

// Test KSES filtering of disallowed attribute.
Expand All @@ -69,7 +69,7 @@ public function test_post_content_disallowed_attr() {
$id = self::factory()->post->create( array( 'post_content' => $content ) );
$post = get_post( $id );

$this->assertSame( $expected, $post->post_content );
$this->assertEqualHTML( $expected, $post->post_content );
}

/**
Expand All @@ -89,7 +89,7 @@ public function test_post_content_xhtml_empty_elem() {
$id = self::factory()->post->create( array( 'post_content' => $content ) );
$post = get_post( $id );

$this->assertSame( $expected, $post->post_content );
$this->assertEqualHTML( $expected, $post->post_content );
}

// Make sure unbalanced tags are untouched when the balance option is off.
Expand All @@ -109,6 +109,6 @@ public function test_post_content_nobalance_nextpage_more() {
$id = self::factory()->post->create( array( 'post_content' => $content ) );
$post = get_post( $id );

$this->assertSame( $content, $post->post_content );
$this->assertEqualHTML( $content, $post->post_content );
}
}
Loading