1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

Refactor unit tests to have one logical assertion per method.

- Support executing a single unit tests using __only prefix
- Hook in Email classes to main code, even if they're unused


git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1373 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-08-06 06:22:23 +00:00
parent d51d3c127b
commit 3af6457801
26 changed files with 471 additions and 693 deletions

View File

@@ -11,27 +11,29 @@ class HTMLPurifier_AttrTransform_BoolToCSSTest extends HTMLPurifier_AttrTransfor
$this->obj = new HTMLPurifier_AttrTransform_BoolToCSS('foo', 'bar:3in;');
}
function test() {
function testEmptyInput() {
$this->assertResult( array() );
}
function testBasicTransform() {
$this->assertResult(
array('foo' => 'foo'),
array('style' => 'bar:3in;')
);
// boolean attribute just has to be set: we don't care about
// anything else
}
function testIgnoreValueOfBooleanAttribute() {
$this->assertResult(
array('foo' => 'no'),
array('style' => 'bar:3in;')
);
}
function testPrependCSS() {
$this->assertResult(
array('foo' => 'foo', 'style' => 'background-color:#F00;'),
array('style' => 'bar:3in;background-color:#F00;')
);
}
}