Whoops, forgot to edit WHATSNEW
[htmlpurifier.git] / tests / HTMLPurifier / DefinitionCache / DecoratorTest.php
blobed560687db939325dd77d08501755fcf5a600cb9
1 <?php
3 class HTMLPurifier_DefinitionCache_DecoratorTest extends HTMLPurifier_DefinitionCacheHarness
6 public function test()
8 generate_mock_once('HTMLPurifier_DefinitionCache');
9 $mock = new HTMLPurifier_DefinitionCacheMock();
10 $mock->type = 'Test';
12 $cache = new HTMLPurifier_DefinitionCache_Decorator();
13 $cache = $cache->decorate($mock);
15 $this->assertIdentical($cache->type, $mock->type);
17 $def = $this->generateDefinition();
18 $config = $this->generateConfigMock();
20 $mock->expectOnce('add', array($def, $config));
21 $cache->add($def, $config);
23 $mock->expectOnce('set', array($def, $config));
24 $cache->set($def, $config);
26 $mock->expectOnce('replace', array($def, $config));
27 $cache->replace($def, $config);
29 $mock->expectOnce('get', array($config));
30 $cache->get($config);
32 $mock->expectOnce('flush', array($config));
33 $cache->flush($config);
35 $mock->expectOnce('cleanup', array($config));
36 $cache->cleanup($config);
42 // vim: et sw=4 sts=4