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.

AttrDefHarness.php 704B

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