/** * @TODO: This is just a transitional test that can be removed once * createRegistration does not use the old registration model anymore. * * @test */ public function createRegistrationCreatesOldAndNewRegistrationModelForTheSameUid() { // Drops the non-saving mapper so that the registration mapper (once we // use it) actually saves the registration. tx_oelib_MapperRegistry::purgeInstance(); tx_oelib_MapperRegistry::getInstance()->activateTestingMode($this->testingFramework); $this->testingFramework->markTableAsDirty('tx_seminars_seminars'); $this->createAndLogInFrontEndUser(); $plugin = new tx_seminars_FrontEnd_DefaultController(); $plugin->cObj = $GLOBALS['TSFE']->cObj; $fixture = $this->getMock('tx_seminars_registrationmanager', array('notifyAttendee', 'notifyOrganizers', 'sendAdditionalNotification', 'setRegistrationData')); $registration = $fixture->createRegistration($this->seminar, array(), $plugin); $uid = $fixture->getRegistration()->getUid(); // @TODO: This line needs to be removed once createRegistration uses // the data mapper to save the registration. tx_oelib_db::delete('tx_seminars_attendances', 'uid = ' . $uid); self::assertSame($registration->getUid(), $fixture->getRegistration()->getUid()); }
/** * @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()); }