/** * @test */ public function sendRemindersToOrganizersForEventWithOneRegistrationsSendsReminderWithMessageWithNumberOfRegistrations() { $eventUid = $this->createSeminarWithOrganizer(array('begin_date' => $GLOBALS['SIM_EXEC_TIME'] + tx_oelib_Time::SECONDS_PER_DAY, 'cancelled' => tx_seminars_seminar::STATUS_CONFIRMED)); $this->testingFramework->createRecord('tx_seminars_attendances', array('title' => 'test registration', 'seminar' => $eventUid, 'user' => $this->testingFramework->createFrontEndUser())); $this->fixture->sendEventTakesPlaceReminders(); self::assertContains('1', $this->mailer->getFirstSentEmail()->getBody()); }
/** * @test */ public function sendAdditionalNotificationForEventWithEnoughAttendancesAndUnlimitedVacanciesShowsVacanciesLabelWithUnlimitedLabel() { $this->testingFramework->changeRecord('tx_seminars_seminars', $this->seminarUid, array('attendees_min' => 1, 'attendees_max' => 0, 'needs_registration' => 1)); $this->fixture->setConfigurationValue('showSeminarFieldsInNotificationMail', 'vacancies'); $registration = $this->createRegistration(); $this->fixture->sendAdditionalNotification($registration); self::assertContains($this->fixture->translate('label_vacancies') . ': ' . $this->fixture->translate('label_unlimited'), $this->mailer->getFirstSentEmail()->getBody()); }
/** * @test */ public function sendEmailToAttendeesSendsEmailWithNameOfRegisteredUserOnSubmitOfValidForm() { $this->testingFramework->createRecord('tx_seminars_attendances', array('pid' => $this->dummySysFolderUid, 'seminar' => $this->eventUid, 'user' => $this->testingFramework->createFrontEndUser('', array('email' => '*****@*****.**', 'name' => 'foo User')))); $messageBody = '%' . $GLOBALS['LANG']->getLL('mailForm_salutation') . $GLOBALS['LANG']->getLL('confirmMailForm_prefillField_messageBody'); $this->fixture->setPostData(array('action' => 'confirmEvent', 'isSubmitted' => '1', 'sender' => $this->organizerUid, 'subject' => 'foo', 'messageBody' => $messageBody)); $this->fixture->render(); self::assertContains('foo User', $this->mailer->getFirstSentEmail()->getBody()); }
/** * @test */ public function sendAdditionalNotificationEmailToReviewerHasEventDateInBody() { $beginDate = mktime(10, 0, 0, 4, 2, 1975); $this->fixture->setSavedFormValue('begin_date', $beginDate); $this->configuration->setAsBoolean('sendAdditionalNotificationEmailInFrontEndEditor', TRUE); $this->fixture->setConfigurationValue('dateFormatYMD', '%d.%m.%Y'); $this->createAndLoginUserWithReviewer(); $this->fixture->sendAdditionalNotificationEmailToReviewer(); self::assertNotNull($this->mailer->getFirstSentEmail()); self::assertContains('02.04.1975', $this->mailer->getFirstSentEmail()->getBody()); }
/** * @test */ public function sendRemindersToOrganizersForCliBackendUserWithLanguageGermanSendsReminderInGerman() { /** @var tx_seminars_Model_BackEndUser $user */ $user = tx_oelib_MapperRegistry::get('tx_oelib_Mapper_BackEndUser')->findByCliKey(); $this->testingFramework->changeRecord('be_users', $user->getUid(), array('lang' => 'de')); tx_oelib_MapperRegistry::purgeInstance(); $this->addSpeaker($this->createSeminarWithOrganizer(array('begin_date' => $GLOBALS['SIM_EXEC_TIME'] + tx_oelib_Time::SECONDS_PER_DAY, 'cancelled' => tx_seminars_seminar::STATUS_PLANNED))); $this->fixture->sendCancellationDeadlineReminders(); $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('seminars') . 'locallang.xml'); $GLOBALS['LANG']->lang = 'de'; $subject = $GLOBALS['LANG']->getLL('email_cancelationDeadlineReminderSubject'); $subject = str_replace('%event', '', $subject); self::assertContains($subject, $this->mailer->getFirstSentEmail()->getSubject()); }
/** * @test */ public function sendCanAddTwoAttachments() { $sender = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('', '*****@*****.**'); $recipient = new Tx_Oelib_Tests_Unit_Fixtures_TestingMailRole('John Doe', $this->email['recipient']); $eMail = new Tx_Oelib_Mail(); $eMail->setSender($sender); $eMail->addRecipient($recipient); $eMail->setSubject($this->email['subject']); $eMail->setMessage($this->email['message']); $attachment1 = new Tx_Oelib_Attachment(); $attachment1->setFileName(t3lib_extMgm::extPath('oelib', 'Tests/Unit/Fixtures/test.txt')); $attachment1->setContentType('text/plain'); $eMail->addAttachment($attachment1); $attachment2 = new Tx_Oelib_Attachment(); $attachment2->setFileName(t3lib_extMgm::extPath('oelib', 'Tests/Unit/Fixtures/test_2.css')); $attachment2->setContentType('text/css'); $eMail->addAttachment($attachment2); $this->subject->send($eMail); $children = $this->subject->getFirstSentEmail()->getChildren(); self::assertSame(2, count($children)); }