You are viewing a plain text version of this content. The canonical link for it is here.
Posted to zeta-commits@incubator.apache.org by de...@apache.org on 2011/04/16 13:27:39 UTC

[zeta-commits] svn commit: r1093994 - in /incubator/zetacomponents/trunk/Mail/tests/parser: data/pine/uppercase-charset.mail parser_test.php

Author: derick
Date: Sat Apr 16 13:27:39 2011
New Revision: 1093994

URL: http://svn.apache.org/viewvc?rev=1093994&view=rev
Log:
- Added the test for #ZETACOMP-75.

Added:
    incubator/zetacomponents/trunk/Mail/tests/parser/data/pine/uppercase-charset.mail
Modified:
    incubator/zetacomponents/trunk/Mail/tests/parser/parser_test.php

Added: incubator/zetacomponents/trunk/Mail/tests/parser/data/pine/uppercase-charset.mail
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Mail/tests/parser/data/pine/uppercase-charset.mail?rev=1093994&view=auto
==============================================================================
--- incubator/zetacomponents/trunk/Mail/tests/parser/data/pine/uppercase-charset.mail (added)
+++ incubator/zetacomponents/trunk/Mail/tests/parser/data/pine/uppercase-charset.mail Sat Apr 16 13:27:39 2011
@@ -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 <de...@example.org>
+X-X-Sender: derick@whisky
+To: "HACHE, Louis" <lo...@example.com>
+bcc: Derick Rethans <de...@example.org>
+Subject: RE: [xdebug-general] Xdebug & crappy firewall
+In-Reply-To: <13...@DE0-MAILMBX-P13.res.example.corp>
+Message-ID: <al...@whisky>
+References: <32...@DE0-MAILMBX-P13.res.example.corp> <26...@whisky>
+ <13...@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

Modified: incubator/zetacomponents/trunk/Mail/tests/parser/parser_test.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Mail/tests/parser/parser_test.php?rev=1093994&r1=1093993&r2=1093994&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Mail/tests/parser/parser_test.php (original)
+++ incubator/zetacomponents/trunk/Mail/tests/parser/parser_test.php Sat Apr 16 13:27:39 2011
@@ -524,6 +524,28 @@ class ezcMailParserTest extends ezcTestC
         $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
     //