Add documents on how to restructure configuration directives.
[htmlpurifier.git] / tests / HTMLPurifier / ChildDef / ChameleonTest.php
blob82493f40eb2c41d98c36c737efb9fc22d94744da
1 <?php
3 class HTMLPurifier_ChildDef_ChameleonTest extends HTMLPurifier_ChildDefHarness
6 protected $isInline;
8 function setUp() {
9 parent::setUp();
10 $this->obj = new HTMLPurifier_ChildDef_Chameleon(
11 'b | i', // allowed only when in inline context
12 'b | i | div' // allowed only when in block context
14 $this->context->register('IsInline', $this->isInline);
17 function testInlineAlwaysAllowed() {
18 $this->isInline = true;
19 $this->assertResult(
20 '<b>Allowed.</b>'
24 function testBlockNotAllowedInInline() {
25 $this->isInline = true;
26 $this->assertResult(
27 '<div>Not allowed.</div>', ''
31 function testBlockAllowedInNonInline() {
32 $this->isInline = false;
33 $this->assertResult(
34 '<div>Allowed.</div>'
40 // vim: et sw=4 sts=4