Links: No rel
'; $expected = 'Links: No rel
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } public function test_add_to_links_with_target_foo() { $content = 'Links: No rel
'; $expected = 'Links: No rel
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } public function test_target_as_first_attribute() { $content = 'Links: No rel
'; $expected = 'Links: No rel
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } public function test_add_to_existing_rel() { $content = 'Links: Existing rel
'; $expected = 'Links: Existing rel
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } public function test_no_duplicate_values_added() { @@ -41,31 +41,31 @@ public function test_no_duplicate_values_added() { public function test_rel_with_single_quote_delimiter() { $content = 'Links: Existing rel
'; $expected = 'Links: Existing rel
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } public function test_rel_with_no_delimiter() { $content = 'Links: Existing rel
'; $expected = 'Links: Existing rel
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } public function test_rel_value_spaced_and_no_delimiter() { $content = 'Links: Existing rel
'; $expected = 'Links: Existing rel
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } public function test_escaped_quotes() { $content = 'Links: Existing rel
'; $expected = 'Links: Existing rel
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } public function test_ignore_links_with_no_target() { $content = 'Links: Change me Do not change me
'; $expected = 'Links: Change me Do not change me
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } /** @@ -77,7 +77,7 @@ public function test_ignore_if_wp_targeted_link_rel_nulled() { add_filter( 'wp_targeted_link_rel', '__return_empty_string' ); $content = 'Links: Do not change me
'; $expected = 'Links: Do not change me
'; - $this->assertSame( $expected, wp_targeted_link_rel( $content ) ); + $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) ); } /** @@ -95,7 +95,7 @@ public function test_wp_targeted_link_rel_filters_run() { ) ); - $this->assertSame( $expected, $post->post_content ); + $this->assertEqualMarkup( $expected, $post->post_content ); } /** @@ -106,7 +106,7 @@ public function test_wp_targeted_link_rel_filters_run() { public function test_wp_targeted_link_rel_should_preserve_json() { $content = 'Links: No rel<\/a><\/p>';
$expected = ' Links: No rel<\/a><\/p>';
- $this->assertSame( $expected, wp_targeted_link_rel( $content ) );
+ $this->assertEqualMarkup( $expected, wp_targeted_link_rel( $content ) );
}
/**
@@ -117,7 +117,7 @@ public function test_wp_targeted_link_rel_should_preserve_json() {
public function test_wp_targeted_link_rel_skips_style_and_scripts() {
$content = ' Links: here aq Links: here aq Links: No Rel Links: No Rel Links: No rel Links: No rel ', $output );
@@ -574,6 +607,7 @@ public function test_render_media() {
)
);
$output = ob_get_clean();
+ // @TODO: Update this test once $p->has_class() is available.
$this->assertStringContainsString( 'class="wp-caption alignnone"', $output );
$this->assertStringContainsString( ' Default caption Custom caption Caption for an image with custom size