1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +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,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_AlphaValueTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_AlphaValue();
$this->assertDef('0');

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_BackgroundPositionTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_BackgroundPosition();
// explicitly cited in spec

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_BackgroundTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$config = HTMLPurifier_Config::createDefault();
$this->def = new HTMLPurifier_AttrDef_CSS_Background($config);

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_BorderTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$config = HTMLPurifier_Config::createDefault();
$this->def = new HTMLPurifier_AttrDef_CSS_Border($config);

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_ColorTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Color();
$this->assertDef('#F00');

View File

@@ -5,7 +5,8 @@ class HTMLPurifier_AttrDef_CSS_Composite_Testable extends
{
// we need to pass by ref to get the mocks in
function HTMLPurifier_AttrDef_CSS_Composite_Testable(&$defs) {
public function HTMLPurifier_AttrDef_CSS_Composite_Testable(&$defs)
{
$this->defs =& $defs;
}
@@ -16,8 +17,8 @@ class HTMLPurifier_AttrDef_CSS_CompositeTest extends HTMLPurifier_AttrDefHarness
protected $def1, $def2;
function test() {
public function test()
{
generate_mock_once('HTMLPurifier_AttrDef');
$config = HTMLPurifier_Config::createDefault();

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_FilterTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Filter();
$this->assertDef('none');

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_FontFamilyTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_FontFamily();
$this->assertDef('Gill, Helvetica, sans-serif');
@@ -36,7 +36,8 @@ class HTMLPurifier_AttrDef_CSS_FontFamilyTest extends HTMLPurifier_AttrDefHarnes
//$this->assertDef('"\'"', "\"'\"");
}
function testAllowed() {
public function testAllowed()
{
$this->config->set('CSS.AllowedFonts', array('serif', 'Times New Roman'));
$this->assertDef('serif');

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_FontTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$config = HTMLPurifier_Config::createDefault();
$this->def = new HTMLPurifier_AttrDef_CSS_Font($config);

View File

@@ -6,39 +6,46 @@ class HTMLPurifier_AttrDef_CSS_ImportantDecoratorTest extends HTMLPurifier_AttrD
/** Mock AttrDef decorator is wrapping */
protected $mock;
function setUp() {
public function setUp()
{
generate_mock_once('HTMLPurifier_AttrDef');
$this->mock = new HTMLPurifier_AttrDefMock();
$this->def = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($this->mock, true);
}
protected function setMock($input, $output = null) {
protected function setMock($input, $output = null)
{
if ($output === null) $output = $input;
$this->mock->expectOnce('validate', array($input, $this->config, $this->context));
$this->mock->setReturnValue('validate', $output);
}
function testImportant() {
public function testImportant()
{
$this->setMock('23');
$this->assertDef('23 !important');
}
function testImportantInternalDefChanged() {
public function testImportantInternalDefChanged()
{
$this->setMock('23', '24');
$this->assertDef('23 !important', '24 !important');
}
function testImportantWithSpace() {
public function testImportantWithSpace()
{
$this->setMock('23');
$this->assertDef('23 ! important ', '23 !important');
}
function testFakeImportant() {
public function testFakeImportant()
{
$this->setMock('! foo important');
$this->assertDef('! foo important');
}
function testStrip() {
public function testStrip()
{
$this->def = new HTMLPurifier_AttrDef_CSS_ImportantDecorator($this->mock, false);
$this->setMock('23');
$this->assertDef('23 ! important ', '23');

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_LengthTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Length();
$this->assertDef('0');
@@ -26,8 +26,8 @@ class HTMLPurifier_AttrDef_CSS_LengthTest extends HTMLPurifier_AttrDefHarness
}
function testNonNegative() {
public function testNonNegative()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Length('0');
$this->assertDef('3cm');
@@ -35,7 +35,8 @@ class HTMLPurifier_AttrDef_CSS_LengthTest extends HTMLPurifier_AttrDefHarness
}
function testBounding() {
public function testBounding()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Length('-1in', '1in');
$this->assertDef('1cm');
$this->assertDef('-1cm');

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_ListStyleTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$config = HTMLPurifier_Config::createDefault();
$this->def = new HTMLPurifier_AttrDef_CSS_ListStyle($config);

View File

@@ -4,7 +4,8 @@
class HTMLPurifier_AttrDef_CSS_MultipleTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Multiple(
new HTMLPurifier_AttrDef_Integer()
);

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_NumberTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Number();
$this->assertDef('0');
@@ -38,8 +38,8 @@ class HTMLPurifier_AttrDef_CSS_NumberTest extends HTMLPurifier_AttrDefHarness
}
function testNonNegative() {
public function testNonNegative()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Number(true);
$this->assertDef('23');
$this->assertDef('-12', false);

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_PercentageTest extends HTMLPurifier_AttrDefHarness
{
function test() {
public function test()
{
$this->def = new HTMLPurifier_AttrDef_CSS_Percentage();
$this->assertDef('10%');

View File

@@ -3,8 +3,8 @@
class HTMLPurifier_AttrDef_CSS_TextDecorationTest extends HTMLPurifier_AttrDefHarness
{
function testCaseInsensitive() {
public function testCaseInsensitive()
{
$this->def = new HTMLPurifier_AttrDef_CSS_TextDecoration();
$this->assertDef('none');

View File

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