0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-23 17:01:51 +00:00
htmlpurifier/tests/HTMLPurifier/DefinitionCache/DecoratorTest.php
Marcus Bointon fac747bdbd 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>
2013-08-17 22:27:26 -04:00

43 lines
1.1 KiB
PHP

<?php
class HTMLPurifier_DefinitionCache_DecoratorTest extends HTMLPurifier_DefinitionCacheHarness
{
public function test()
{
generate_mock_once('HTMLPurifier_DefinitionCache');
$mock = new HTMLPurifier_DefinitionCacheMock();
$mock->type = 'Test';
$cache = new HTMLPurifier_DefinitionCache_Decorator();
$cache = $cache->decorate($mock);
$this->assertIdentical($cache->type, $mock->type);
$def = $this->generateDefinition();
$config = $this->generateConfigMock();
$mock->expectOnce('add', array($def, $config));
$cache->add($def, $config);
$mock->expectOnce('set', array($def, $config));
$cache->set($def, $config);
$mock->expectOnce('replace', array($def, $config));
$cache->replace($def, $config);
$mock->expectOnce('get', array($config));
$cache->get($config);
$mock->expectOnce('flush', array($config));
$cache->flush($config);
$mock->expectOnce('cleanup', array($config));
$cache->cleanup($config);
}
}
// vim: et sw=4 sts=4