2006-11-22 18:55:15 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_ChildDef_OptionalTest extends HTMLPurifier_ChildDefHarness
|
|
|
|
{
|
|
|
|
|
2007-08-06 06:22:23 +00:00
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
2006-11-22 18:55:15 +00:00
|
|
|
$this->obj = new HTMLPurifier_ChildDef_Optional('b | i');
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testBasicUsage() {
|
2006-11-22 18:55:15 +00:00
|
|
|
$this->assertResult('<b>Bold text</b><img />', '<b>Bold text</b>');
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testRemoveForbiddenText() {
|
2006-11-22 18:55:15 +00:00
|
|
|
$this->assertResult('Not allowed text', '');
|
|
|
|
}
|
|
|
|
|
2007-10-02 01:19:46 +00:00
|
|
|
function testEmpty() {
|
|
|
|
$this->assertResult('');
|
|
|
|
}
|
|
|
|
|
2008-12-03 01:13:47 +00:00
|
|
|
function testWhitespace() {
|
|
|
|
$this->assertResult(' ');
|
|
|
|
}
|
|
|
|
|
|
|
|
function testMultipleWhitespace() {
|
|
|
|
$this->assertResult(' ');
|
|
|
|
}
|
|
|
|
|
2006-11-22 18:55:15 +00:00
|
|
|
}
|