From 431186c659a71b3bc720c2968ebde6de4fb3aee3 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Philipp=20Sch=C3=BCle?=
Date: Wed, 10 Sep 2014 19:16:25 +0200
Subject: [PATCH 1/1] only assert organizer reply if notification backend is
configured
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
Change-Id: I9187de21cf13374ad82aa95a41ada1f5fa7f8a18
Reviewed-on: http://gerrit.tine20.com/customers/1126
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle
---
tests/tine20/Calendar/Frontend/iMIPTest.php | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/tests/tine20/Calendar/Frontend/iMIPTest.php b/tests/tine20/Calendar/Frontend/iMIPTest.php
index 02048fe..a260684 100644
--- a/tests/tine20/Calendar/Frontend/iMIPTest.php
+++ b/tests/tine20/Calendar/Frontend/iMIPTest.php
@@ -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');
+ }
}
/**
--
2.7.4