1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-06 06:07:26 +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:
Marcus Bointon
2013-07-16 13:56:14 +02:00
committed by Edward Z. Yang
parent 19eee14899
commit fac747bdbd
433 changed files with 13302 additions and 6690 deletions

View File

@@ -3,14 +3,16 @@
class HTMLPurifier_AttrDef_HTML_BoolTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_HTML_Bool('foo');
$this->assertDef('foo');
$this->assertDef('', false);
$this->assertDef('bar', 'foo');
}
function test_make() {
public function test_make()
{
$factory = new HTMLPurifier_AttrDef_HTML_Bool();
$def = $factory->make('foo');
$def2 = new HTMLPurifier_AttrDef_HTML_Bool('foo');

View File

@@ -2,23 +2,27 @@
class HTMLPurifier_AttrDef_HTML_ClassTest extends HTMLPurifier_AttrDef_HTML_NmtokensTest
{
function setUp() {
public function setUp()
{
parent::setUp();
$this->def = new HTMLPurifier_AttrDef_HTML_Class();
}
function testAllowedClasses() {
public function testAllowedClasses()
{
$this->config->set('Attr.AllowedClasses', array('foo'));
$this->assertDef('foo');
$this->assertDef('bar', false);
$this->assertDef('foo bar', 'foo');
}
function testForbiddenClasses() {
public function testForbiddenClasses()
{
$this->config->set('Attr.ForbiddenClasses', array('bar'));
$this->assertDef('foo');
$this->assertDef('bar', false);
$this->assertDef('foo bar', 'foo');
}
function testDefault() {
public function testDefault()
{
$this->assertDef('valid');
$this->assertDef('a0-_');
$this->assertDef('-valid');
@@ -40,7 +44,8 @@ class HTMLPurifier_AttrDef_HTML_ClassTest extends HTMLPurifier_AttrDef_HTML_Nmto
// test duplicate removal
$this->assertDef('valid valid', 'valid');
}
function testXHTML11Behavior() {
public function testXHTML11Behavior()
{
$this->config->set('HTML.Doctype', 'XHTML 1.1');
$this->assertDef('0invalid', false);
$this->assertDef('valid valid', 'valid');

View File

@@ -3,7 +3,8 @@
class HTMLPurifier_AttrDef_HTML_ColorTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_HTML_Color();
$this->assertDef('', false);
$this->assertDef('foo', false);

View File

@@ -3,19 +3,22 @@
class HTMLPurifier_AttrDef_HTML_FrameTargetTest extends HTMLPurifier_AttrDefHarness
{
function setup() {
public function setup()
{
parent::setup();
$this->def = new HTMLPurifier_AttrDef_HTML_FrameTarget();
}
function testNoneAllowed() {
public function testNoneAllowed()
{
$this->assertDef('', false);
$this->assertDef('foo', false);
$this->assertDef('_blank', false);
$this->assertDef('baz', false);
}
function test() {
public function test()
{
$this->config->set('Attr.AllowedFrameTargets', 'foo,_blank');
$this->assertDef('', false);
$this->assertDef('foo');

View File

@@ -3,7 +3,8 @@
class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness
{
function setUp() {
public function setUp()
{
parent::setUp();
$id_accumulator = new HTMLPurifier_IDAccumulator();
@@ -13,8 +14,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness
}
function test() {
public function test()
{
// valid ID names
$this->assertDef('alpha');
$this->assertDef('al_ha');
@@ -35,8 +36,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness
}
function testPrefix() {
public function testPrefix()
{
$this->config->set('Attr.IDPrefix', 'user_');
$this->assertDef('alpha', 'user_alpha');
@@ -50,8 +51,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness
}
function testTwoPrefixes() {
public function testTwoPrefixes()
{
$this->config->set('Attr.IDPrefix', 'user_');
$this->config->set('Attr.IDPrefixLocal', 'story95_');
@@ -64,7 +65,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness
$this->assertDef('user_alas', 'user_story95_user_alas'); // !
}
function testLocalPrefixWithoutMainPrefix() {
public function testLocalPrefixWithoutMainPrefix()
{
// no effect when IDPrefix isn't set
$this->config->set('Attr.IDPrefix', '');
$this->config->set('Attr.IDPrefixLocal', 'story95_');
@@ -75,8 +77,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness
}
// reference functionality is disabled for now
function disabled_testIDReference() {
public function disabled_testIDReference()
{
$this->def = new HTMLPurifier_AttrDef_HTML_ID(true);
$this->assertDef('good_id');
@@ -94,8 +96,8 @@ class HTMLPurifier_AttrDef_HTML_IDTest extends HTMLPurifier_AttrDefHarness
}
function testRegexp() {
public function testRegexp()
{
$this->config->set('Attr.IDBlacklistRegexp', '/^g_/');
$this->assertDef('good_id');

View File

@@ -3,12 +3,13 @@
class HTMLPurifier_AttrDef_HTML_LengthTest extends HTMLPurifier_AttrDef_HTML_PixelsTest
{
function setup() {
public function setup()
{
$this->def = new HTMLPurifier_AttrDef_HTML_Length();
}
function test() {
public function test()
{
// pixel check
parent::test();

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_HTML_LinkTypesTest extends HTMLPurifier_AttrDefHarness
{
function testNull() {
public function testNull()
{
$this->def = new HTMLPurifier_AttrDef_HTML_LinkTypes('rel');
$this->config->set('Attr.AllowedRel', array('nofollow', 'foo'));

View File

@@ -3,12 +3,13 @@
class HTMLPurifier_AttrDef_HTML_MultiLengthTest extends HTMLPurifier_AttrDef_HTML_LengthTest
{
function setup() {
public function setup()
{
$this->def = new HTMLPurifier_AttrDef_HTML_MultiLength();
}
function test() {
public function test()
{
// length check
parent::test();

View File

@@ -3,13 +3,14 @@
class HTMLPurifier_AttrDef_HTML_NmtokensTest extends HTMLPurifier_AttrDefHarness
{
function setUp() {
public function setUp()
{
parent::setUp();
$this->def = new HTMLPurifier_AttrDef_HTML_Nmtokens();
}
function testDefault() {
public function testDefault()
{
$this->assertDef('valid');
$this->assertDef('a0-_');
$this->assertDef('-valid');

View File

@@ -3,12 +3,13 @@
class HTMLPurifier_AttrDef_HTML_PixelsTest extends HTMLPurifier_AttrDefHarness
{
function setup() {
public function setup()
{
$this->def = new HTMLPurifier_AttrDef_HTML_Pixels();
}
function test() {
public function test()
{
$this->assertDef('1');
$this->assertDef('0');
@@ -33,7 +34,8 @@ class HTMLPurifier_AttrDef_HTML_PixelsTest extends HTMLPurifier_AttrDefHarness
}
function test_make() {
public function test_make()
{
$factory = new HTMLPurifier_AttrDef_HTML_Pixels();
$this->def = $factory->make('30');
$this->assertDef('25');