[1.4.0] Added convenient single test selector form on test runner
[htmlpurifier.git] / tests / HTMLPurifier / AttrDef / EmailHarness.php
blob28bd06f1338b8c5c6731ffcff516033ddfd655ff
1 <?php
3 require_once 'HTMLPurifier/AttrDef/Email.php';
4 require_once 'HTMLPurifier/AttrDefHarness.php';
6 class HTMLPurifier_AttrDef_EmailHarness extends HTMLPurifier_AttrDefHarness
9 /**
10 * Tests common email strings that are obviously pass/fail
12 function testCore() {
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>');
23 // time to fail
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);