2007-03-29 21:41:17 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_AttrTransform_BorderTest extends HTMLPurifier_AttrTransformHarness
|
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-03-29 21:41:17 +00:00
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
$this->obj = new HTMLPurifier_AttrTransform_Border();
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-08-06 06:22:23 +00:00
|
|
|
function testEmptyInput() {
|
2007-03-29 21:41:17 +00:00
|
|
|
$this->assertResult( array() );
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-08-06 06:22:23 +00:00
|
|
|
function testBasicTransform() {
|
2007-03-29 21:41:17 +00:00
|
|
|
$this->assertResult(
|
|
|
|
array('border' => '1'),
|
|
|
|
array('style' => 'border:1px solid;')
|
|
|
|
);
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-08-06 06:22:23 +00:00
|
|
|
function testLenientTreatmentOfInvalidInput() {
|
2007-03-29 21:41:17 +00:00
|
|
|
$this->assertResult(
|
|
|
|
array('border' => '10%'),
|
|
|
|
array('style' => 'border:10%px solid;')
|
|
|
|
);
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-08-06 06:22:23 +00:00
|
|
|
function testPrependNewCSS() {
|
2007-03-29 21:41:17 +00:00
|
|
|
$this->assertResult(
|
|
|
|
array('border' => '23', 'style' => 'font-weight:bold;'),
|
|
|
|
array('style' => 'border:23px solid;font-weight:bold;')
|
|
|
|
);
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-03-29 21:41:17 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|