gordonmcvey / reefknot

Reefknot framework for PHP
Apache License 2.0
5 stars 0 forks source link

Valid emails rejected by Email prop #1

Open gordonmcvey opened 12 years ago

gordonmcvey commented 12 years ago

The following unit tests for valid email addresses fail

    public function testIsValidGoodAddrPasses8 ()
    {
        /* 
         * According to Wikipedia this is a valid email address, but it fails.  
         * Either the address isn't valid or there's a bug in the email 
         * validator
         */
        $this -> object -> setData ('very."(),:;<>[]".VERY."very\\\ \@\"very".unusual@strange.example.com');
        $this -> assertTrue ($this -> object -> isValid ());
    }

    public function testIsValidGoodAddrPasses9 ()
    {
        /* 
         * According to Wikipedia this is a valid email address, but it fails.  
         * Either the address isn't valid or there's a bug in the email 
         * validator
         */
        $this -> object -> setData ('Abc\@def@example.com');
        $this -> assertTrue ($this -> object -> isValid ());
    }

Wikipedia claims that the above email address strings are valid.

gordonmcvey commented 12 years ago

This should validate too, but it doesn't. Apparently the PHP team decided that this should not be allowed.

    public function testIsValidGoodAddrPasses10 ()
    {
        $this -> object -> setData ('test@example');
        $this -> assertTrue ($this -> object -> isValid ());
    }