summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2015-04-15 12:14:58 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2015-04-15 12:14:58 +0200
commitcda714c353f489717442e04a1979fcc988e5aa08 (patch)
treebbe4ca76a38ba52c23d9f9f4717447639509dbc1 /tests
parent99f1aedd70a37b8763f0d72e0db223ede62190f3 (diff)
remove test for global article enhancer
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/articleenhancer/GlobalArticleEnhancerTest.php81
1 files changed, 0 insertions, 81 deletions
diff --git a/tests/unit/articleenhancer/GlobalArticleEnhancerTest.php b/tests/unit/articleenhancer/GlobalArticleEnhancerTest.php
deleted file mode 100644
index 79647a882..000000000
--- a/tests/unit/articleenhancer/GlobalArticleEnhancerTest.php
+++ /dev/null
@@ -1,81 +0,0 @@
-<?php
-/**
- * ownCloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Alessandro Cosentino <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
- */
-
-namespace OCA\News\ArticleEnhancer;
-
-use \OCA\News\Db\Item;
-
-
-class GlobalArticleEnhancerTest extends \PHPUnit_Framework_TestCase {
-
- private $enhancer;
-
- protected function setUp() {
- $this->enhancer = new GlobalArticleEnhancer();
- }
-
-
- public function testNoReplaceYoutubeAutoplay() {
- $body = '<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);
-
- $result = $this->enhancer->enhance($item);
- $this->assertEquals($expected, $result->getBody());
- }
-
-
- 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 = '<div>test <iframe width="728" height="410" ' .
- 'src="//www.youtube.com/embed' .
- '/AWE6UpXQoGU?tst=1&amp;autoplay=0&amp;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);
-
- $result = $this->enhancer->enhance($item);
- $this->assertEquals($expected, $result->getBody());
- }
-
-}