3 require_once 'HTMLPurifier/AttrDef/Email.php';
4 require_once 'HTMLPurifier/AttrDefHarness.php';
6 class HTMLPurifier_AttrDef_EmailHarness
extends HTMLPurifier_AttrDefHarness
10 * Tests common email strings that are obviously pass/fail
13 $this->assertDef('bob@example.com');
14 $this->assertDef(' bob@example.com ', 'bob@example.com');
15 $this->assertDef('bob.thebuilder@example.net');
16 $this->assertDef('Bob_the_Builder-the-2nd@example.org');
17 $this->assertDef('Bob%20the%20Builder@white-space.test');
19 // extended format, with real name
20 //$this->assertDef('Bob%20Builder%20%3Cbobby.bob.bob@it.is.example.com%3E');
21 //$this->assertDef('Bob Builder <bobby.bob.bob@it.is.example.com>');
24 $this->assertDef('bob', false);
25 $this->assertDef('bob@home@work', false);
26 $this->assertDef('@example.com', false);
27 $this->assertDef('bob@', false);
28 $this->assertDef('', false);