Bug #9525: Add validation tests
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Jan 2011 04:11:52 +0000 (21:11 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 20 Jan 2011 04:11:52 +0000 (21:11 -0700)
framework/Mail/test/Horde/Mail/ParseTest.php

index 9856d7c..618406b 100644 (file)
@@ -189,4 +189,33 @@ class Horde_Mail_ParseTest extends PHPUnit_Framework_TestCase
         $this->assertEquals(count($res), 3);
     }
 
+    public function testBug9525()
+    {
+        $parser = new Horde_Mail_Rfc822();
+
+        try {
+            $ob = $parser->parseAddressList(
+                'ß <test@example.com>',
+                array(
+                    'default_domain' => 'example.com',
+                    'validate' => true
+                )
+            );
+
+            $this->fail('Expecting Exception.');
+        } catch (Horde_Mail_Exception $e) {}
+
+        try {
+            $ob = $parser->parseAddressList(
+                '"ß" <test@example.com>',
+                array(
+                    'default_domain' => 'example.com',
+                    'validate' => true
+                )
+            );
+        } catch (Horde_Mail_Exception $e) {
+            $this->fail('Unexpected Exception.');
+        }
+    }
+
 }