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:26:50 UTC

[zeta-commits] svn commit: r1093993 - in /incubator/zetacomponents/trunk/Mail: ChangeLog src/tools.php tests/tools_test.php

Author: derick
Date: Sat Apr 16 13:26:49 2011
New Revision: 1093993

URL: http://svn.apache.org/viewvc?rev=1093993&view=rev
Log:
- Fixed #ZETACOMP-76: MailTools::replyTo will always use REPLY_ALL instead of
  distinguishing between REPLY_ALL and REPLY_SENDER.

Modified:
    incubator/zetacomponents/trunk/Mail/ChangeLog
    incubator/zetacomponents/trunk/Mail/src/tools.php
    incubator/zetacomponents/trunk/Mail/tests/tools_test.php

Modified: incubator/zetacomponents/trunk/Mail/ChangeLog
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Mail/ChangeLog?rev=1093993&r1=1093992&r2=1093993&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Mail/ChangeLog (original)
+++ incubator/zetacomponents/trunk/Mail/ChangeLog Sat Apr 16 13:26:49 2011
@@ -10,6 +10,8 @@
   errors in destructor.
 - Fixed #ZETACOMP-75: Mail parser doesn't understand uppercase "CHARSET" that
   alpine uses.
+- Fixed #ZETACOMP-76: MailTools::replyTo will always use REPLY_ALL instead of
+  distinguishing between REPLY_ALL and REPLY_SENDER.
 
 
 1.7 - Monday 21 December 2009

Modified: incubator/zetacomponents/trunk/Mail/src/tools.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Mail/src/tools.php?rev=1093993&r1=1093992&r2=1093993&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Mail/src/tools.php (original)
+++ incubator/zetacomponents/trunk/Mail/src/tools.php Sat Apr 16 13:26:49 2011
@@ -42,7 +42,7 @@ class ezcMailTools
     /**
      * Reply to all.
      */
-    const REPLY_ALL = 1;
+    const REPLY_ALL = 2;
 
     /**
      * Server to use for validateEmailAddressMx(). Change this if this server

Modified: incubator/zetacomponents/trunk/Mail/tests/tools_test.php
URL: http://svn.apache.org/viewvc/incubator/zetacomponents/trunk/Mail/tests/tools_test.php?rev=1093993&r1=1093992&r2=1093993&view=diff
==============================================================================
--- incubator/zetacomponents/trunk/Mail/tests/tools_test.php (original)
+++ incubator/zetacomponents/trunk/Mail/tests/tools_test.php Sat Apr 16 13:26:49 2011
@@ -387,6 +387,27 @@ class ezcMailToolsTest extends ezcTestCa
         );
     }
 
+	// test for ZETACOMP-76
+    public function testReplyToSelf()
+    {
+        $parser = new ezcMailParser();
+        $set = new ezcMailFileSet( array( dirname( __FILE__ )
+                                          . '/parser/data/various/multiple_recipients' ) );
+        $mail = $parser->parseMail( $set );
+
+        $reply = ezcMailTools::replyToMail( $mail[0],
+                                            new ezcMailAddress( 'test@example.com', 'Reply Guy' ),
+                                            ezcMailTools::REPLY_SENDER, 'Antwoord: ' );
+
+        $this->assertEquals( array( new ezcMailAddress( 'fh@ez.no', 'Frederik Holljen', 'utf-8' ) ),
+                             $reply->to );
+        $this->assertEquals( new ezcMailAddress( 'test@example.com', 'Reply Guy' ), $reply->from );
+        $this->assertEquals( array(), $reply->cc );
+        $this->assertEquals( 'Antwoord: Simple mail with text subject and body', $reply->subject );
+        $this->assertEquals( '<20...@ez.no>', $reply->getHeader( 'In-Reply-To' ) );
+        $this->assertEquals( '<12...@example.com> <20...@ez.no>', $reply->getHeader( 'References' ) );
+    }
+
     public function testReplyToAll()
     {
         $parser = new ezcMailParser();