improves testSaveMessageInFolder() in test
[tine20] / tests / tine20 / Felamimail / Frontend / JsonTest.php
index b7162c9..416c7a4 100644 (file)
@@ -1112,17 +1112,16 @@ class Felamimail_Frontend_JsonTest extends TestCase
         $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->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');
     }
     
     /**