/** * @test */ public function sendAdditionalNotificationForEventWithEnoughAttendancesAndUnlimitedVacanciesSendsEmail() { $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('attendees_min' => 1, 'attendees_max' => 0, 'needs_registration' => 1)); $registration = $this->createRegistration(); $this->fixture->sendAdditionalNotification($registration); self::assertSame(1, $this->mailer->getNumberOfSentEmails()); }
/** * @test */ public function eventEditorForEventHiddenByFormDoesSendMail() { $seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars'); $this->createAndLoginUserWithReviewer(); $this->fixture->setObjectUid($seminarUid); $formData = $this->fixture->modifyDataToInsert(array()); $this->testingFramework->changeRecord('tx_seminars_seminars', $seminarUid, array('hidden' => 1, 'publication_hash' => $formData['publication_hash'])); $this->fixture->sendEMailToReviewer(); self::assertGreaterThan(0, $this->mailer->getNumberOfSentEmails()); }
/** * @test */ public function sendCancellationDeadlineRemindersForPlannedEventWithTwoOrganizersAndOptionEnabledSendsTwoReminders() { $eventUid = $this->createSeminarWithOrganizer(array('begin_date' => $GLOBALS['SIM_EXEC_TIME'] + tx_oelib_Time::SECONDS_PER_DAY, 'cancelled' => tx_seminars_seminar::STATUS_PLANNED)); $this->addSpeaker($eventUid); $organizerUid = $this->testingFramework->createRecord('tx_seminars_organizers', array('title' => 'foo', 'email' => '*****@*****.**')); $this->testingFramework->createRelation('tx_seminars_seminars_organizers_mm', $eventUid, $organizerUid); $this->testingFramework->changeRecord('tx_seminars_seminars', $eventUid, array('organizers' => 2)); $this->fixture->sendCancellationDeadlineReminders(); self::assertSame(2, $this->mailer->getNumberOfSentEmails()); }
/** * @test */ public function sendForTwoRecipientsSendsTwoEmails() { $sender = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('', '*****@*****.**'); $eMail = new Tx_Oelib_Mail(); $eMail->setSender($sender); $eMail->setSubject($this->email['subject']); $eMail->setMessage($this->email['message']); $recipient1 = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('John Doe', '*****@*****.**'); $eMail->addRecipient($recipient1); $recipient2 = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('Jane Doe', '*****@*****.**'); $eMail->addRecipient($recipient2); $this->subject->send($eMail); self::assertSame(2, $this->subject->getNumberOfSentEmails()); }