Author: Alexandru Stanoi
Date: 2007-02-05 14:21:37 +0100 (Mon, 05 Feb 2007)
New Revision: 4626

Log:
- Fixed a small issue where new options could not be added to IMAP or POP3
  options classes.

Modified:
   trunk/Mail/src/transports/imap/imap_transport.php
   trunk/Mail/src/transports/pop3/pop3_transport.php
   trunk/Mail/src/transports/transport_connection.php
   trunk/Mail/tests/transports/transport_pop3_test.php

Modified: trunk/Mail/src/transports/imap/imap_transport.php
===================================================================
--- trunk/Mail/src/transports/imap/imap_transport.php   2007-02-05 10:37:58 UTC 
(rev 4625)
+++ trunk/Mail/src/transports/imap/imap_transport.php   2007-02-05 13:21:37 UTC 
(rev 4626)
@@ -209,7 +209,7 @@
         {
             $port = ( $this->options->ssl === true ) ? 993 : 143;
         }
-        $this->connection = new ezcMailTransportConnection( $server, $port, 
$options );
+        $this->connection = new ezcMailTransportConnection( $server, $port, 
$this->options );
         // get the server greeting
         $response = $this->connection->getLine();
         if ( strpos( $response, "* OK" ) === false )

Modified: trunk/Mail/src/transports/pop3/pop3_transport.php
===================================================================
--- trunk/Mail/src/transports/pop3/pop3_transport.php   2007-02-05 10:37:58 UTC 
(rev 4625)
+++ trunk/Mail/src/transports/pop3/pop3_transport.php   2007-02-05 13:21:37 UTC 
(rev 4626)
@@ -130,7 +130,7 @@
         {
             $port = ( $this->options->ssl === true ) ? 995 : 110;
         }
-        $this->connection = new ezcMailTransportConnection( $server, $port, 
$options );
+        $this->connection = new ezcMailTransportConnection( $server, $port, 
$this->options );
         $this->greeting = $this->connection->getLine();
         if ( !$this->isPositiveResponse( $this->greeting ) )
         {
@@ -491,7 +491,7 @@
      * @param int $numLines
      * @return string
      */
-    public function top( $msgNum, $numLines )
+    public function top( $msgNum, $numLines = 0 )
     {
         if ( $this->state != self::STATE_TRANSACTION )
         {

Modified: trunk/Mail/src/transports/transport_connection.php
===================================================================
--- trunk/Mail/src/transports/transport_connection.php  2007-02-05 10:37:58 UTC 
(rev 4625)
+++ trunk/Mail/src/transports/transport_connection.php  2007-02-05 13:21:37 UTC 
(rev 4626)
@@ -58,13 +58,20 @@
      *         if $options contains a property with a value not allowed
      * @param string $server
      * @param int $port
-     * @param array(string=>mixed) $options
+     * @param ezcMailTransportOptions $options
      */
-    public function __construct( $server, $port, array $options = array() )
+    public function __construct( $server, $port, ezcMailTransportOptions 
$options = null )
     {
         $errno = null;
         $errstr = null;
-        $this->options = new ezcMailTransportOptions( $options );
+        if ( $options === null )
+        {
+            $this->options = new ezcMailTransportOptions();
+        }
+        else
+        {
+            $this->options = $options;
+        }
         if ( $this->options->ssl )
         {
             if ( ezcBaseFeatures::hasExtensionSupport( 'openssl' ) !== true )

Modified: trunk/Mail/tests/transports/transport_pop3_test.php
===================================================================
--- trunk/Mail/tests/transports/transport_pop3_test.php 2007-02-05 10:37:58 UTC 
(rev 4625)
+++ trunk/Mail/tests/transports/transport_pop3_test.php 2007-02-05 13:21:37 UTC 
(rev 4626)
@@ -443,6 +443,19 @@
         }
     }
 
+    public function testTransportPropertiesBefore()
+    {
+        $options = array( 'authenticationMethod' => 
ezcMailPop3Transport::AUTH_PLAIN_TEXT );
+        $pop3 = new ezcMailPop3Transport( "dolly.ez.no", null, $options );
+    }
+
+    public function testTransportConnection()
+    {
+        $connection = new ezcMailTransportConnection( "dolly.ez.no", 143 );
+        $expected = new ezcMailTransportOptions();
+        $this->assertEquals( $expected, $connection->options );
+    }
+
     public function testServerSSL()
     {
         if ( !ezcBaseFeatures::hasExtensionSupport( 'openssl' ) )

-- 
svn-components mailing list
svn-components@lists.ez.no
http://lists.ez.no/mailman/listinfo/svn-components

Reply via email to