1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-01 11:50:28 +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

@@ -6,23 +6,27 @@ class HTMLPurifier_DefinitionCacheFactoryTest extends HTMLPurifier_Harness
protected $factory;
protected $oldFactory;
public function setUp() {
public function setUp()
{
parent::setup();
$this->factory = new HTMLPurifier_DefinitionCacheFactory();
$this->oldFactory = HTMLPurifier_DefinitionCacheFactory::instance();
HTMLPurifier_DefinitionCacheFactory::instance($this->factory);
}
public function tearDown() {
public function tearDown()
{
HTMLPurifier_DefinitionCacheFactory::instance($this->oldFactory);
}
function test_create() {
public function test_create()
{
$cache = $this->factory->create('Test', $this->config);
$this->assertEqual($cache, new HTMLPurifier_DefinitionCache_Serializer('Test'));
}
function test_create_withDecorator() {
public function test_create_withDecorator()
{
$this->factory->addDecorator('Memory');
$cache = $this->factory->create('Test', $this->config);
$cache_real = new HTMLPurifier_DefinitionCache_Decorator_Memory();
@@ -30,7 +34,8 @@ class HTMLPurifier_DefinitionCacheFactoryTest extends HTMLPurifier_Harness
$this->assertEqual($cache, $cache_real);
}
function test_create_withDecoratorObject() {
public function test_create_withDecoratorObject()
{
$this->factory->addDecorator(new HTMLPurifier_DefinitionCache_Decorator_Memory());
$cache = $this->factory->create('Test', $this->config);
$cache_real = new HTMLPurifier_DefinitionCache_Decorator_Memory();
@@ -38,26 +43,30 @@ class HTMLPurifier_DefinitionCacheFactoryTest extends HTMLPurifier_Harness
$this->assertEqual($cache, $cache_real);
}
function test_create_recycling() {
public function test_create_recycling()
{
$cache = $this->factory->create('Test', $this->config);
$cache2 = $this->factory->create('Test', $this->config);
$this->assertReference($cache, $cache2);
}
function test_create_invalid() {
public function test_create_invalid()
{
$this->config->set('Cache.DefinitionImpl', 'Invalid');
$this->expectError('Unrecognized DefinitionCache Invalid, using Serializer instead');
$cache = $this->factory->create('Test', $this->config);
$this->assertIsA($cache, 'HTMLPurifier_DefinitionCache_Serializer');
}
function test_null() {
public function test_null()
{
$this->config->set('Cache.DefinitionImpl', null);
$cache = $this->factory->create('Test', $this->config);
$this->assertEqual($cache, new HTMLPurifier_DefinitionCache_Null('Test'));
}
function test_register() {
public function test_register()
{
generate_mock_once('HTMLPurifier_DefinitionCache');
$this->config->set('Cache.DefinitionImpl', 'TestCache');
$this->factory->register('TestCache', $class = 'HTMLPurifier_DefinitionCacheMock');