Release 2.0.1, merged in 1181 to HEAD.
[htmlpurifier.git] / tests / HTMLPurifier / ChildDef / ChameleonTest.php
blob676bbe48f402158c6af8bab8a9edbf78699b4865
1 <?php
3 require_once 'HTMLPurifier/ChildDefHarness.php';
4 require_once 'HTMLPurifier/ChildDef/Chameleon.php';
6 class HTMLPurifier_ChildDef_ChameleonTest extends HTMLPurifier_ChildDefHarness
9 function test() {
11 $this->obj = new HTMLPurifier_ChildDef_Chameleon(
12 'b | i', // allowed only when in inline context
13 'b | i | div' // allowed only when in block context
16 $this->assertResult(
17 '<b>Allowed.</b>', true,
18 array(), array('IsInline' => true)
21 $this->assertResult(
22 '<div>Not allowed.</div>', '',
23 array(), array('IsInline' => true)
26 $this->assertResult(
27 '<div>Allowed.</div>', true,
28 array(), array('IsInline' => false)