Prepended constants with C_ to avoid reserved words as per https://www.php.net/manual...
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / HTMLModule / ImageTest.php
blob67ffceaeedad2c041be4a9f1055abbaeac425373
1 <?php
3 class HTMLPurifier_HTMLModule_ImageTest extends HTMLPurifier_HTMLModuleHarness
7 public function testNormal()
9 $this->assertResult('<img height="40" width="40" src="" alt="" />');
12 public function testLengthTooLarge()
14 $this->assertResult(
15 '<img height="40000" width="40000" src="" alt="" />',
16 '<img height="1200" width="1200" src="" alt="" />'
20 public function testLengthPercentage()
22 $this->assertResult(
23 '<img height="100%" width="100%" src="" alt="" />',
24 '<img src="" alt="" />'
28 public function testLengthCustomMax()
30 $this->config->set('HTML.MaxImgLength', 20);
31 $this->assertResult(
32 '<img height="30" width="30" src="" alt="" />',
33 '<img height="20" width="20" src="" alt="" />'
37 public function testLengthCrashFixDisabled()
39 $this->config->set('HTML.MaxImgLength', null);
40 $this->assertResult(
41 '<img height="100%" width="100%" src="" alt="" />'
43 $this->assertResult(
44 '<img height="40000" width="40000" src="" alt="" />'
48 public function testLengthTrusted()
50 $this->config->set('HTML.Trusted', true);
51 $this->assertResult(
52 '<img height="100%" width="100%" src="" alt="" />'
54 $this->assertResult(
55 '<img height="40000" width="40000" src="" alt="" />'
61 // vim: et sw=4 sts=4