Tests: wpautop() should not add extra </p> before <figcaption>.

Props pbearne.
See #39307.

git-svn-id: https://develop.svn.wordpress.org/trunk@39914 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2017-01-16 17:56:34 +00:00
parent 79589f4195
commit 708c750b2e

View File

@@ -534,4 +534,28 @@ line 2<br/>
$this->assertEquals( $expected, trim( wpautop( $content ) ) );
}
/**
* wpautop() should not add extra </p> before <figcaption>
*
* @covers ::wpautop
* @uses trim
*
* @ticket 39307
*/
function test_that_wpautop_doses_not_add_extra_closing_p_in_figure() {
$content1 = $expected1 = '<figure><img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
$content2 = '<figure>
<img src="example.jpg" />
<figcaption>Caption</figcaption>
</figure>';
$expected2 = '<figure>
<img src="example.jpg" /><figcaption>Caption</figcaption></figure>';
$this->assertEquals( $expected1, trim( wpautop( $content1 ) ) );
$this->assertEquals( $expected2, trim( wpautop( $content2 ) ) );
}
}