fixes attachment name test
authorPhilipp Schüle <p.schuele@metaways.de>
Mon, 10 Apr 2017 12:14:57 +0000 (14:14 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Mon, 10 Apr 2017 12:53:59 +0000 (14:53 +0200)
... spaces are replaced in filenames

Change-Id: Iff3046cc1e622f8140e11061f81da6d2037f7540
Reviewed-on: http://gerrit.tine20.com/customers/4535
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Felamimail/Controller/MessageTest.php

index 231b403..a17535b 100644 (file)
@@ -837,11 +837,12 @@ class Felamimail_Controller_MessageTest extends TestCase
         $forwardedMessage = $this->searchAndCacheMessage(Felamimail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822, $this->getFolder('INBOX'));
         $forwardedMessageInSent = $this->searchAndCacheMessage(Felamimail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822, $sentFolder);
         $completeForwardedMessage = $this->_controller->getCompleteMessage($forwardedMessage);
+        $attachmentName = preg_replace('/\s*/', '', $cachedMessage->subject);
         
         $this->assertEquals(Felamimail_Model_Message::CONTENT_TYPE_MESSAGE_RFC822, $forwardedMessage['structure']['parts'][2]['contentType']);
-        $this->assertEquals($cachedMessage->subject . '.eml', $forwardedMessage['structure']['parts'][2]['parameters']['name'],
+        $this->assertEquals($attachmentName . '.eml', $forwardedMessage['structure']['parts'][2]['parameters']['name'],
             'filename mismatch in structure' . print_r($forwardedMessage['structure']['parts'][2], TRUE));
-        $this->assertEquals($cachedMessage->subject . '.eml', $completeForwardedMessage->attachments[0]['filename'],
+        $this->assertEquals($attachmentName . '.eml', $completeForwardedMessage->attachments[0]['filename'],
             'filename mismatch of attachment' . print_r($completeForwardedMessage->attachments[0], TRUE));
         
         return $forwardedMessage;