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.

33 line
987B

  1. <?php
  2. class HTMLPurifier_AttrDef_URI_EmailHarness extends HTMLPurifier_AttrDefHarness
  3. {
  4. /**
  5. * Tests common email strings that are obviously pass/fail
  6. */
  7. public function testCore()
  8. {
  9. $this->assertDef('bob@example.com');
  10. $this->assertDef(' bob@example.com ', 'bob@example.com');
  11. $this->assertDef('bob.thebuilder@example.net');
  12. $this->assertDef('Bob_the_Builder-the-2nd@example.org');
  13. $this->assertDef('Bob%20the%20Builder@white-space.test');
  14. // extended format, with real name
  15. //$this->assertDef('Bob%20Builder%20%3Cbobby.bob.bob@it.is.example.com%3E');
  16. //$this->assertDef('Bob Builder <bobby.bob.bob@it.is.example.com>');
  17. // time to fail
  18. $this->assertDef('bob', false);
  19. $this->assertDef('bob@home@work', false);
  20. $this->assertDef('@example.com', false);
  21. $this->assertDef('bob@', false);
  22. $this->assertDef('', false);
  23. }
  24. }
  25. // vim: et sw=4 sts=4