function test_errors() { $cache = new HTMLPurifier_DefinitionCache_Serializer('Test'); $def = $this->generateDefinition(); $def->setup = true; $def->type = 'NotTest'; $config = $this->generateConfigMock('testfoo'); $this->expectError('Cannot use definition of type NotTest in cache for Test'); $cache->add($def, $config); $this->expectError('Cannot use definition of type NotTest in cache for Test'); $cache->set($def, $config); $this->expectError('Cannot use definition of type NotTest in cache for Test'); $cache->replace($def, $config); }