[Felamimail] make testSaveMessageInFolder test more robust
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 2 Aug 2017 13:56:46 +0000 (15:56 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 3 Aug 2017 11:49:53 +0000 (13:49 +0200)
Change-Id: Id9082a83324341c1397c75b5d0956143531e0740
Reviewed-on: http://gerrit.tine20.com/customers/5380
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Felamimail/Frontend/JsonTest.php

index 52d6e73..1a7c2be 100644 (file)
@@ -1114,17 +1114,16 @@ class Felamimail_Frontend_JsonTest extends TestCase
         $messageToSave = $this->_getMessageData();
         $messageToSave['bcc'] = array('bccaddress@email.org', 'bccaddress2@email.org');
         
         $messageToSave = $this->_getMessageData();
         $messageToSave['bcc'] = array('bccaddress@email.org', 'bccaddress2@email.org');
         
-        $draftsFolder = $this->_getFolder($this->_account->drafts_folder);
-        $returned = $this->_json->saveMessageInFolder($this->_account->drafts_folder, $messageToSave);
+        $this->_getFolder($this->_account->drafts_folder);
+        $this->_json->saveMessageInFolder($this->_account->drafts_folder, $messageToSave);
         $this->_foldersToClear = array($this->_account->drafts_folder);
         
         // check if message is in drafts folder and recipients are present
         $message = $this->_searchForMessageBySubject($messageToSave['subject'], $this->_account->drafts_folder);
         $this->_foldersToClear = array($this->_account->drafts_folder);
         
         // check if message is in drafts folder and recipients are present
         $message = $this->_searchForMessageBySubject($messageToSave['subject'], $this->_account->drafts_folder);
-        $this->assertEquals($messageToSave['subject'],  $message['subject']);
-        $this->assertEquals($messageToSave['to'][0],    $message['to'][0], 'recipient not found');
-        $this->assertEquals(2, count($message['bcc']), 'bcc recipient not found: ' . print_r($message, TRUE));
-        $this->assertEquals($messageToSave['bcc'][0],   $message['bcc'][0], '1st bcc recipient not found');
-        $this->assertEquals($messageToSave['bcc'][1],   $message['bcc'][1], '2nd bcc recipient not found');
+        self::assertEquals($messageToSave['subject'],  $message['subject']);
+        self::assertEquals($messageToSave['to'][0],    $message['to'][0], 'recipient not found');
+        self::assertEquals(2, count($message['bcc']), 'bcc recipient not found: ' . print_r($message, TRUE));
+        self::assertContains('bccaddress',   $message['bcc'][0], 'bcc recipient not found');
     }
     
     /**
     }
     
     /**