Merge branch '2015.11-develop' into 2016.11
authorPhilipp Schüle <p.schuele@metaways.de>
Tue, 8 Nov 2016 13:57:23 +0000 (14:57 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Tue, 8 Nov 2016 13:57:23 +0000 (14:57 +0100)
1  2 
tests/tine20/Felamimail/Frontend/JsonTest.php
tine20/Tinebase/Mail.php
tine20/composer.lock

@@@ -565,20 -568,24 +568,26 @@@ class Felamimail_Frontend_JsonTest exte
      /**
       * test send message to invalid recipient
       */
-     public function testSendMessageToInvalidRecipient()
+     public function testSendMessageToInvalidRecipient($invalidEmail = null, $toField = 'to', $expectedExceptionMessage = 'Recipient address rejected')
      {
 +        $this->markTestSkipped('FIXME: 0011802: Felamimail_Frontend_JsonTest::testSendMessageToInvalidRecipient fails');
 +
          $messageToSend = $this->_getMessageData($this->_account->email);
-         $invalidEmail = 'invaliduser@' . $this->_mailDomain;
-         $messageToSend['to'] = array($invalidEmail);
+         if ($invalidEmail === null) {
+             $invalidEmail = 'invaliduser@' . $this->_mailDomain;
+         }
+         if ($toField !== 'to') {
+             $messageToSend['to'] = array(Tinebase_Core::getUser()->accountEmailAddress);
+         }
+         $messageToSend[$toField] = array($invalidEmail);
          $translation = Tinebase_Translation::getTranslation('Felamimail');
-         
          try {
-             $returned = $this->_json->saveMessage($messageToSend);
+             $this->_json->saveMessage($messageToSend);
              $this->fail('Tinebase_Exception_SystemGeneric expected');
          } catch (Tinebase_Exception_SystemGeneric $tesg) {
-             $this->assertContains('<' . $invalidEmail . '>: ' . $translation->_('Recipient address rejected'), $tesg->getMessage(),
+             $this->assertContains('<' . $invalidEmail . '>: ' . $translation->_($expectedExceptionMessage), $tesg->getMessage(),
                  'exception message did not match: ' . $tesg->getMessage());
          }
      }
Simple merge
Simple merge