You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
981B

  1. <?php
  2. class HTMLPurifier_DefinitionCacheHarness extends HTMLPurifier_Harness
  3. {
  4. /**
  5. * Generate a configuration mock object that returns $values
  6. * to a getBatch() call
  7. * @param $values Values to return when getBatch is invoked
  8. */
  9. protected function generateConfigMock($serial = 'defaultserial')
  10. {
  11. generate_mock_once('HTMLPurifier_Config');
  12. $config = new HTMLPurifier_ConfigMock();
  13. $config->setReturnValue('getBatchSerial', $serial, array('Test'));
  14. $config->version = '1.0.0';
  15. return $config;
  16. }
  17. /**
  18. * Returns an anonymous def that has been setup and named Test
  19. */
  20. protected function generateDefinition($member_vars = array())
  21. {
  22. $def = new HTMLPurifier_DefinitionTestable();
  23. $def->setup = true;
  24. $def->type = 'Test';
  25. foreach ($member_vars as $key => $val) {
  26. $def->$key = $val;
  27. }
  28. return $def;
  29. }
  30. }
  31. // vim: et sw=4 sts=4