Add vim modelines to all files.
[htmlpurifier.git] / tests / HTMLPurifier / HTMLModule / SafeEmbedTest.php
blobec9454b432f6beff0fb4d7db594b6cbaab3789bd
1 <?php
3 class HTMLPurifier_HTMLModule_SafeEmbedTest extends HTMLPurifier_HTMLModuleHarness
6 function setUp() {
7 parent::setUp();
8 $this->config->set('HTML', 'DefinitionID', 'HTMLPurifier_HTMLModule_SafeEmbedTest');
9 $def = $this->config->getHTMLDefinition(true);
10 $def->manager->addModule('SafeEmbed');
13 function testMinimal() {
14 $this->assertResult(
15 '<embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" />',
16 '<embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" allowscriptaccess="never" allownetworking="internal" type="application/x-shockwave-flash" />'
20 function testYouTube() {
21 $this->assertResult(
22 '<embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" type="application/x-shockwave-flash" width="425" height="344"></embed>',
23 '<embed src="http://www.youtube.com/v/RVtEQxH7PWA&amp;hl=en" type="application/x-shockwave-flash" width="425" height="344" allowscriptaccess="never" allownetworking="internal" />'
27 function testMalicious() {
28 $this->assertResult(
29 '<embed src="http://example.com/bad.swf" type="application/x-shockwave-flash" width="9999999" height="3499994" allowscriptaccess="always" allownetworking="always" />',
30 '<embed src="http://example.com/bad.swf" type="application/x-shockwave-flash" width="1200" height="1200" allowscriptaccess="never" allownetworking="internal" />'
34 function testFull() {
35 $this->assertResult(
36 '<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>'
42 // vim: et sw=4 sts=4