Optional support for IDNAs with PEAR Net_IDNA2
[htmlpurifier.git] / tests / HTMLPurifier / HTMLModule / SafeEmbedTest.php
blob779d34857a1aab2832289f01843c04a94cd638d1
1 <?php
3 class HTMLPurifier_HTMLModule_SafeEmbedTest extends HTMLPurifier_HTMLModuleHarness
6 function setUp() {
7 parent::setUp();
8 $def = $this->config->getHTMLDefinition(true);
9 $def->manager->addModule('SafeEmbed');
12 function testMinimal() {
13 $this->assertResult(
14 '<embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" />',
15 '<embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" allowscriptaccess="never" allownetworking="internal" type="application/x-shockwave-flash" />'
19 function testYouTube() {
20 $this->assertResult(
21 '<embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" type="application/x-shockwave-flash" width="425" height="344"></embed>',
22 '<embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" type="application/x-shockwave-flash" width="425" height="344" allowscriptaccess="never" allownetworking="internal" />'
26 function testMalicious() {
27 $this->assertResult(
28 '<embed src="http://example.com/bad.swf" type="application/x-shockwave-flash" width="9999999" height="3499994" allowscriptaccess="always" allownetworking="always" />',
29 '<embed src="http://example.com/bad.swf" type="application/x-shockwave-flash" width="1200" height="1200" allowscriptaccess="never" allownetworking="internal" />'
33 function testFull() {
34 $this->assertResult(
35 '<b><embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" type="application/x-shockwave-flash" width="24" height="23" allowscriptaccess="never" allownetworking="internal" wmode="window" /></b>'
41 // vim: et sw=4 sts=4