From d4f19a20c64aa9abcf396a252f5057139770ac1e Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Mon, 29 Sep 2014 14:08:27 +0200 Subject: require libxml --- .../articleenhancer/GlobalArticleEnhancerTest.php | 26 ++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/unit/articleenhancer/GlobalArticleEnhancerTest.php b/tests/unit/articleenhancer/GlobalArticleEnhancerTest.php index 93f9273ed..84c55ad9d 100644 --- a/tests/unit/articleenhancer/GlobalArticleEnhancerTest.php +++ b/tests/unit/articleenhancer/GlobalArticleEnhancerTest.php @@ -27,7 +27,7 @@ class GlobalArticleEnhancerTest extends \PHPUnit_Framework_TestCase { public function testNoReplaceYoutubeAutoplay() { $body = ''; - $expected = ''; + $expected = '
'; $item = new Item(); $item->setBody($body); @@ -38,7 +38,29 @@ class GlobalArticleEnhancerTest extends \PHPUnit_Framework_TestCase { public function testReplaceYoutubeAutoplay() { $body = 'test '; - $expected = '

test

'; + $expected = '
test
'; + $item = new Item(); + $item->setBody($body); + + $result = $this->enhancer->enhance($item); + $this->assertEquals($expected, $result->getBody()); + } + + + public function testMultipleParagraphs() { + $body = '

paragraph 1

paragraph 2

'; + $expected = '
' . $body . '
'; + $item = new Item(); + $item->setBody($body); + + $result = $this->enhancer->enhance($item); + $this->assertEquals($expected, $result->getBody()); + } + + + public function testMultipleParagraphsInDiv() { + $body = '

paragraph 1

paragraph 2

'; + $expected = '
' . $body . '
'; $item = new Item(); $item->setBody($body); -- cgit v1.2.3