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.

30 lines
915B

  1. <?php
  2. class HTMLPurifier_AttrDef_CSS_URITest extends HTMLPurifier_AttrDefHarness
  3. {
  4. public function test()
  5. {
  6. $this->def = new HTMLPurifier_AttrDef_CSS_URI();
  7. $this->assertDef('', false);
  8. // we could be nice but we won't be
  9. $this->assertDef('http://www.example.com/', false);
  10. $this->assertDef('url(', false);
  11. $this->assertDef('url("")', true);
  12. $result = 'url("http://www.example.com/")';
  13. $this->assertDef('url(http://www.example.com/)', $result);
  14. $this->assertDef('url("http://www.example.com/")', $result);
  15. $this->assertDef("url('http://www.example.com/')", $result);
  16. $this->assertDef(
  17. ' url( "http://www.example.com/" ) ', $result);
  18. $this->assertDef("url(http://www.example.com/foo,bar\)\'\()",
  19. 'url("http://www.example.com/foo,bar%29%27%28")');
  20. }
  21. }
  22. // vim: et sw=4 sts=4