AttrDefHarness.php 689 B

123456789101112131415161718192021222324252627
  1. <?php
  2. class HTMLPurifier_AttrDefHarness extends HTMLPurifier_Harness
  3. {
  4. protected $def;
  5. protected $context, $config;
  6. public function setUp() {
  7. $this->config = HTMLPurifier_Config::createDefault();
  8. $this->context = new HTMLPurifier_Context();
  9. }
  10. // cannot be used for accumulator
  11. function assertDef($string, $expect = true) {
  12. // $expect can be a string or bool
  13. $result = $this->def->validate($string, $this->config, $this->context);
  14. if ($expect === true) {
  15. $this->assertIdentical($string, $result);
  16. } else {
  17. $this->assertIdentical($expect, $result);
  18. }
  19. }
  20. }
  21. // vim: et sw=4 sts=4