Location: PHPKode > projects > Volunteer Management OpenSource Software > vmoss_alpha02/3rd/htmlpurifier/tests/HTMLPurifier/AttrDef/URI/EmailHarness.php
<?php

require_once 'HTMLPurifier/AttrDef/URI/Email.php';
require_once 'HTMLPurifier/AttrDefHarness.php';

class HTMLPurifier_AttrDef_URI_EmailHarness extends HTMLPurifier_AttrDefHarness
{
    
    /**
     * Tests common email strings that are obviously pass/fail
     */
    function testCore() {
        $this->assertDef('hide@address.com');
        $this->assertDef('  hide@address.com  ', 'hide@address.com');
        $this->assertDef('hide@address.com');
        $this->assertDef('Bob_the_Builder-the-hide@address.com');
        $this->assertDef('Bob%20the%hide@address.com');
        
        // extended format, with real name
        //$this->assertDef('Bob%20Builder%20%hide@address.com%3E');
        //$this->assertDef('Bob Builder <hide@address.com>');
        
        // time to fail
        $this->assertDef('bob', false);
        $this->assertDef('hide@address.com@work', false);
        $this->assertDef('@example.com', false);
        $this->assertDef('bob@', false);
        $this->assertDef('', false);
        
    }
    
}

Return current item: Volunteer Management OpenSource Software