diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-05 11:30:27 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-05 11:30:38 +0100 |
commit | 95530f62513a82c385d9378b4a59da57d74092d9 (patch) | |
tree | a4d17994548999b42e99371f381da8c256ee39bf /3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php | |
parent | 57163ad25a7dc63abd8aff8663c185ddad398466 (diff) |
update picofeed, add max size setting, fix #642
Diffstat (limited to '3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php')
-rw-r--r-- | 3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php b/3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php new file mode 100644 index 000000000..86911bbb4 --- /dev/null +++ b/3rdparty/fguillot/picofeed/tests/Filter/TagFilterTest.php @@ -0,0 +1,33 @@ +<?php +namespace PicoFeed\Filter; + +use PHPUnit_Framework_TestCase; + + +class TagFilterTest extends PHPUnit_Framework_TestCase +{ + public function testAllowedTag() + { + $tag = new Tag; + + $this->assertTrue($tag->isAllowed('p', array('class' => 'test'))); + $this->assertTrue($tag->isAllowed('img', array('class' => 'test'))); + + $this->assertFalse($tag->isAllowed('script', array('class' => 'test'))); + $this->assertFalse($tag->isAllowed('img', array('width' => '1', 'height' => '1'))); + } + + public function testHtml() + { + $tag = new Tag; + + $this->assertEquals('<p>', $tag->openHtmlTag('p')); + $this->assertEquals('<img src="test" alt="truc"/>', $tag->openHtmlTag('img', 'src="test" alt="truc"')); + $this->assertEquals('<img/>', $tag->openHtmlTag('img')); + $this->assertEquals('<br/>', $tag->openHtmlTag('br')); + + $this->assertEquals('</p>', $tag->closeHtmlTag('p')); + $this->assertEquals('', $tag->closeHtmlTag('img')); + $this->assertEquals('', $tag->closeHtmlTag('br')); + } +} |