diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-29 14:08:27 +0200 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-09-29 14:08:27 +0200 |
commit | d4f19a20c64aa9abcf396a252f5057139770ac1e (patch) | |
tree | e4abc873acb80b445ff28f729b26d371edf13fa1 /tests | |
parent | ade0ecb98ba1cdc5436b70e2eca5c5ea6356b0da (diff) |
require libxml
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/articleenhancer/GlobalArticleEnhancerTest.php | 26 |
1 files changed, 24 insertions, 2 deletions
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 = '<iframe width="728" height="410" src="//www.youtube.com/embed/autoplay=1/AWE6UpXQoGU" frameborder="0" allowfullscreen=""></iframe>'; - $expected = '<iframe width="728" height="410" src="//www.youtube.com/embed/autoplay=1/AWE6UpXQoGU" frameborder="0" allowfullscreen=""></iframe>'; + $expected = '<div><iframe width="728" height="410" src="//www.youtube.com/embed/autoplay=1/AWE6UpXQoGU" frameborder="0" allowfullscreen=""></iframe></div>'; $item = new Item(); $item->setBody($body); @@ -38,7 +38,29 @@ class GlobalArticleEnhancerTest extends \PHPUnit_Framework_TestCase { public function testReplaceYoutubeAutoplay() { $body = 'test <iframe width="728" height="410" src="//www.youtube.com/embed/AWE6UpXQoGU?tst=1&autoplay=1&abc=1" frameborder="0" allowfullscreen=""></iframe>'; - $expected = '<p>test <iframe width="728" height="410" src="//www.youtube.com/embed/AWE6UpXQoGU?tst=1&autoplay=0&abc=1" frameborder="0" allowfullscreen=""></iframe></p>'; + $expected = '<div>test <iframe width="728" height="410" src="//www.youtube.com/embed/AWE6UpXQoGU?tst=1&autoplay=0&abc=1" frameborder="0" allowfullscreen=""></iframe></div>'; + $item = new Item(); + $item->setBody($body); + + $result = $this->enhancer->enhance($item); + $this->assertEquals($expected, $result->getBody()); + } + + + public function testMultipleParagraphs() { + $body = '<p>paragraph 1</p><p>paragraph 2</p>'; + $expected = '<div>' . $body . '</div>'; + $item = new Item(); + $item->setBody($body); + + $result = $this->enhancer->enhance($item); + $this->assertEquals($expected, $result->getBody()); + } + + + public function testMultipleParagraphsInDiv() { + $body = '<p>paragraph 1</p><p>paragraph 2</p>'; + $expected = '<div>' . $body . '</div>'; $item = new Item(); $item->setBody($body); |