mirror of
https://github.com/chylex/Nextcloud-News.git
synced 2025-04-09 19:15:42 +02:00
remove test for global article enhancer
This commit is contained in:
parent
99f1aedd70
commit
cda714c353
@ -178,9 +178,6 @@ class Application extends App {
|
||||
->setClientTimeout($config->getFeedFetcherTimeout())
|
||||
->setMaxRedirections($config->getMaxRedirects())
|
||||
->setMaxBodySize($config->getMaxSize())
|
||||
// enable again if we can distinguish between security and
|
||||
// content filtering
|
||||
//->setContentFiltering(false)
|
||||
->setParserHashAlgo('md5');
|
||||
|
||||
// proxy settings
|
||||
|
File diff suppressed because one or more lines are too long
@ -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&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);
|
||||
|
||||
$result = $this->enhancer->enhance($item);
|
||||
$this->assertEquals($expected, $result->getBody());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user