mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-04 05:07:55 +02:00
PSR-2 reformatting PHPDoc corrections
With minor corrections. Signed-off-by: Marcus Bointon <marcus@synchromedia.co.uk> Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
committed by
Edward Z. Yang
parent
19eee14899
commit
fac747bdbd
@@ -3,46 +3,53 @@
|
||||
class HTMLPurifier_Strategy_ValidateAttributes_IDTest extends HTMLPurifier_StrategyHarness
|
||||
{
|
||||
|
||||
function setUp() {
|
||||
public function setUp()
|
||||
{
|
||||
parent::setUp();
|
||||
$this->obj = new HTMLPurifier_Strategy_ValidateAttributes();
|
||||
$this->config->set('Attr.EnableID', true);
|
||||
}
|
||||
|
||||
|
||||
function testPreserveIDWhenEnabled() {
|
||||
public function testPreserveIDWhenEnabled()
|
||||
{
|
||||
$this->assertResult('<div id="valid">Preserve the ID.</div>');
|
||||
}
|
||||
|
||||
function testRemoveInvalidID() {
|
||||
public function testRemoveInvalidID()
|
||||
{
|
||||
$this->assertResult(
|
||||
'<div id="0invalid">Kill the ID.</div>',
|
||||
'<div>Kill the ID.</div>'
|
||||
);
|
||||
}
|
||||
|
||||
function testRemoveDuplicateID() {
|
||||
public function testRemoveDuplicateID()
|
||||
{
|
||||
$this->assertResult(
|
||||
'<div id="valid">Valid</div><div id="valid">Invalid</div>',
|
||||
'<div id="valid">Valid</div><div>Invalid</div>'
|
||||
);
|
||||
}
|
||||
|
||||
function testAttributeKeyCaseInsensitivity() {
|
||||
public function testAttributeKeyCaseInsensitivity()
|
||||
{
|
||||
$this->assertResult(
|
||||
'<div ID="valid">Convert ID to lowercase.</div>',
|
||||
'<div id="valid">Convert ID to lowercase.</div>'
|
||||
);
|
||||
}
|
||||
|
||||
function testTrimWhitespace() {
|
||||
public function testTrimWhitespace()
|
||||
{
|
||||
$this->assertResult(
|
||||
'<div id=" valid ">Trim whitespace.</div>',
|
||||
'<div id="valid">Trim whitespace.</div>'
|
||||
);
|
||||
}
|
||||
|
||||
function testIDBlacklist() {
|
||||
public function testIDBlacklist()
|
||||
{
|
||||
$this->config->set('Attr.IDBlacklist', array('invalid'));
|
||||
$this->assertResult(
|
||||
'<div id="invalid">Invalid</div>',
|
||||
@@ -50,7 +57,8 @@ class HTMLPurifier_Strategy_ValidateAttributes_IDTest extends HTMLPurifier_Strat
|
||||
);
|
||||
}
|
||||
|
||||
function testNameConvertedToID() {
|
||||
public function testNameConvertedToID()
|
||||
{
|
||||
$this->config->set('HTML.TidyLevel', 'heavy');
|
||||
$this->assertResult(
|
||||
'<a name="foobar" />',
|
||||
|
Reference in New Issue
Block a user