From 708c750b2e8c9f6443c94d13647fd3095cc2eb39 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 16 Jan 2017 17:56:34 +0000 Subject: [PATCH] Tests: `wpautop()` should not add extra `

` before `
`. Props pbearne. See #39307. git-svn-id: https://develop.svn.wordpress.org/trunk@39914 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/formatting/Autop.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/phpunit/tests/formatting/Autop.php b/tests/phpunit/tests/formatting/Autop.php index 62251d78ca..b92af0f110 100644 --- a/tests/phpunit/tests/formatting/Autop.php +++ b/tests/phpunit/tests/formatting/Autop.php @@ -534,4 +534,28 @@ line 2
$this->assertEquals( $expected, trim( wpautop( $content ) ) ); } + + /** + * wpautop() should not add extra

before
+ * + * @covers ::wpautop + * @uses trim + * + * @ticket 39307 + */ + function test_that_wpautop_doses_not_add_extra_closing_p_in_figure() { + $content1 = $expected1 = '
Caption
'; + + $content2 = '
+ +
Caption
+
'; + + $expected2 = '
+
Caption
'; + + $this->assertEquals( $expected1, trim( wpautop( $content1 ) ) ); + $this->assertEquals( $expected2, trim( wpautop( $content2 ) ) ); + } + }