- Added the test for #ZETACOMP-75.


git-svn-id: https://svn.apache.org/repos/asf/incubator/zetacomponents/trunk@1093994 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/Mail/tests/parser/data/pine/uppercase-charset.mail b/Mail/tests/parser/data/pine/uppercase-charset.mail
new file mode 100644
index 0000000..5214cf6
--- /dev/null
+++ b/Mail/tests/parser/data/pine/uppercase-charset.mail
@@ -0,0 +1,47 @@
+From derick@example.com Wed Mar 30 15:56:27 2011 +0100
+Date: Wed, 30 Mar 2011 15:56:26 +0100 (BST)
+From: Derick Rethans <derick@example.org>
+X-X-Sender: derick@whisky
+To: "HACHE, Louis" <louis.hache@example.com>
+bcc: Derick Rethans <derick@example.org>
+Subject: RE: [xdebug-general] Xdebug & crappy firewall
+In-Reply-To: <13984_1301484192_4D9312A0_13984_430_1_182BB42C807C6E4D8F73FE42714573183990B033F1@DE0-MAILMBX-P13.res.example.corp>
+Message-ID: <alpine.DEB.2.02.1103301259170.27738@whisky>
+References: <32555_1301480572_4D93047C_32555_788_1_182BB42C807C6E4D8F73FE42714573183990B032B9@DE0-MAILMBX-P13.res.example.corp> <26986_1301481877_4D930995_26986_2307_3_alpine.DEB.2.02.1103301143540.27738@whisky>
+ <13984_1301484192_4D9312A0_13984_430_1_182BB42C807C6E4D8F73FE42714573183990B033F1@DE0-MAILMBX-P13.res.example.corp>
+User-Agent: Alpine 2.02 (DEB 1266 2009-07-14)
+MIME-Version: 1.0
+Content-Type: TEXT/MADEUP; CHARSET=UTF-8
+Status: RO
+X-Status: 
+X-Keywords:                 
+X-UID: 18085
+
+On Wed, 30 Mar 2011, HACHE, Louis wrote:
+
+> On Wed, 20 Mar 2011, Derick Rethans wrote:
+> 
+> > On Wed, 30 Mar 2011, HACHE, Louis wrote:
+> > 
+> > > I'm working on a PHP project with netbeans and xdebug. All is 
+> > > working fine except that there's a crappy firewall which analyses 
+> > > every data transfer on the localhost. Moreover, my computer is 
+> > > really slow. Due to these to things, i can't work, my computer 
+> > > freezes and i have to reboot netbeans and apache.
+> > > 
+> > > Is there a way to configure xdebug in order that he works with a 
+> > > socket and not TCP or UDP or whatever. I want to bypass the 
+> > > firewall.
+> > 
+> > What sort of socket do you mean? You mean unix domain, or Windows 
+> > pipes?
+> 
+That's all right. Everybody makes mistakes :-) I probably could add this 
+to Xdebug quite easily, but the thing is, the protocol specs don't 
+support it (yet) and neither of course will IDEs. If you can get 
+netbeans people willing to commit to adding Windows pipe support as 
+well, then I'll have a look at getting Xdebug to support it.
+
+cheers,
+Derick
+twitter: @derickr and @xdebug
diff --git a/Mail/tests/parser/parser_test.php b/Mail/tests/parser/parser_test.php
index 85e2d2e..da3a9c0 100644
--- a/Mail/tests/parser/parser_test.php
+++ b/Mail/tests/parser/parser_test.php
@@ -524,6 +524,28 @@
         $this->assertEquals( "This is the body with æøå", $parts[0]->text );
     }
 
+    public function testAlpineCharset()
+    {
+        $parser = new ezcMailParser();
+        $set = new SingleFileSet( 'pine/uppercase-charset.mail' );
+        $mail = $parser->parseMail( $set );
+        $this->assertEquals( 1, count( $mail ) );
+        $mail = $mail[0];
+        $this->assertEquals( new ezcMailAddress( 'derick@example.org', 'Derick Rethans', 'utf-8' ), $mail->from );
+        $this->assertEquals( array( new ezcMailAddress( 'louis.hache@example.com', 'HACHE, Louis', 'utf-8' ) ), $mail->to );
+        $this->assertEquals( array( new ezcMailAddress( 'derick@example.org', 'Derick Rethans', 'utf-8' ) ), $mail->bcc );
+        $this->assertEquals( array(), $mail->cc );
+        $this->assertEquals( 'RE: [xdebug-general] Xdebug & crappy firewall', $mail->subject );
+        $this->assertEquals( 'utf-8', $mail->subjectCharset );
+        $this->assertEquals( true, $mail->body instanceof ezcMailText );
+        $this->assertEquals( "utf-8", $mail->body->originalCharset );
+        $this->assertEquals( "utf-8", $mail->body->charset );
+        $this->assertEquals( 'madeup', $mail->body->subType );
+
+        $this->assertEquals( 1301496986, $mail->timestamp );
+        $this->assertEquals( 1301496986, strtotime( $mail->getHeader( 'Date' ) ) );
+    }
+
     // 
     // Hotmail
     //