only assert organizer reply if notification backend is configured
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 10 Sep 2014 17:16:25 +0000 (19:16 +0200)
committerPhilipp Schüle <p.schuele@metaways.de>
Thu, 11 Sep 2014 09:55:19 +0000 (11:55 +0200)
Change-Id: I9187de21cf13374ad82aa95a41ada1f5fa7f8a18
Reviewed-on: http://gerrit.tine20.com/customers/1126
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
tests/tine20/Calendar/Frontend/iMIPTest.php

index 02048fe..a260684 100644 (file)
@@ -307,12 +307,16 @@ class Calendar_Frontend_iMIPTest extends TestCase
         $this->assertEquals(Calendar_Model_Attender::STATUS_ACCEPTED, $ownAttendee->status, 'must be ACCEPTED');
         
         // assert REPLY message to organizer only
-        $messages = Calendar_Controller_EventNotificationsTests::getMessages();
-        $this->assertEquals(1, count($messages), 'exactly one mail should be send');
-        $this->assertTrue(in_array('l.kneschke@caldav.org', $messages[0]->getRecipients()), 'organizer is not a receipient');
-        $this->assertContains('accepted', $messages[0]->getSubject(), 'wrong subject');
-        $this->assertContains('METHOD:REPLY', var_export($messages[0], TRUE), 'method missing');
-        $this->assertContains('SEQUENCE:0', var_export($messages[0], TRUE), 'external sequence has not been keepted');
+        $smtpConfig = Tinebase_Config::getInstance()->get(Tinebase_Config::SMTP);
+        $mailer = Calendar_Controller_EventNotificationsTests::getMailer();
+        if ($mailer instanceof Zend_Mail_Transport_Array || (isset($smtpConfig->from) && ! empty($smtpConfig->from))) {
+            $messages = Calendar_Controller_EventNotificationsTests::getMessages();
+            $this->assertEquals(1, count($messages), 'exactly one mail should be send');
+            $this->assertTrue(in_array('l.kneschke@caldav.org', $messages[0]->getRecipients()), 'organizer is not a receipient');
+            $this->assertContains('accepted', $messages[0]->getSubject(), 'wrong subject');
+            $this->assertContains('METHOD:REPLY', var_export($messages[0], TRUE), 'method missing');
+            $this->assertContains('SEQUENCE:0', var_export($messages[0], TRUE), 'external sequence has not been keepted');
+        }
     }
     
     /**