Sfoglia il codice sorgente

[TESTS]: fix error in Zend_Mail_FileTransportTest path absent not is assigned.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@24326 44c647ce-9c0f-0410-b52a-842ac1e357ba
ramon 14 anni fa
parent
commit
437cf83d59

+ 1 - 1
library/Zend/Mail/Transport/File.php

@@ -86,7 +86,7 @@ class Zend_Mail_Transport_File extends Zend_Mail_Transport_Abstract
      */
     public function setOptions(array $options)
     {
-        if (isset($options['path'])&& is_dir($options['path'])) {
+        if (isset($options['path']) && is_dir($options['path'])) {
             $this->_path = $options['path'];
         }
         if (isset($options['callback']) && is_callable($options['callback'])) {

+ 6 - 1
tests/Zend/Mail/FileTransportTest.php

@@ -118,7 +118,7 @@ class Zend_Mail_FileTransportTest extends PHPUnit_Framework_TestCase
     public function testNotWritablePathFailure()
     {
         $transport = new Zend_Mail_Transport_File(array(
-            'path' => $this->_tmpdir . '/not_existing/directory'
+            'callback' => array($this, 'directoryNotExisting')
         ));
 
         $mail = $this->_prepareMail();
@@ -181,4 +181,9 @@ class Zend_Mail_FileTransportTest extends PHPUnit_Framework_TestCase
         // and default callback part
         $this->assertContains('ZendMail', $entry);
     }
+
+    public function directoryNotExisting($transport)
+    {
+        return $this->_tmpdir . '/not_existing/directory';
+    }
 }