protected function setUp() { $this->extConfBackup = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']; $this->t3VarBackup = $GLOBALS['T3_VAR']['getUserObj']; $this->testingFramework = new tx_oelib_testingFramework('tx_seminars'); $this->testingFramework->createFakeFrontEnd(); /** @var Tx_Oelib_MailerFactory $mailerFactory */ $mailerFactory = t3lib_div::makeInstance('Tx_Oelib_MailerFactory'); $mailerFactory->enableTestMode(); $this->mailer = $mailerFactory->getMailer(); tx_seminars_registrationchild::purgeCachedSeminars(); tx_oelib_configurationProxy::getInstance('seminars')->setAsInteger('eMailFormatForAttendees', tx_seminars_registrationmanager::SEND_TEXT_MAIL); $configurationRegistry = tx_oelib_ConfigurationRegistry::getInstance(); $configurationRegistry->set('plugin.tx_seminars', new Tx_Oelib_Configuration()); $configurationRegistry->set('plugin.tx_seminars._LOCAL_LANG.default', new Tx_Oelib_Configuration()); $configurationRegistry->set('config', new Tx_Oelib_Configuration()); $configurationRegistry->set('page.config', new Tx_Oelib_Configuration()); $organizerUid = $this->testingFramework->createRecord('tx_seminars_organizers', array('title' => 'test organizer', 'email' => '*****@*****.**', 'email_footer' => 'organizer footer')); $this->seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('title' => 'test event', 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] + 1000, 'end_date' => $GLOBALS['SIM_EXEC_TIME'] + 2000, 'attendees_min' => 1, 'attendees_max' => 10, 'needs_registration' => 1, 'organizers' => 1)); $this->testingFramework->createRelation('tx_seminars_seminars_organizers_mm', $this->seminarUid, $organizerUid); tx_oelib_templateHelper::setCachedConfigurationValue('templateFile', 'EXT:seminars/Resources/Private/Templates/Mail/e-mail.html'); $headerProxyFactory = tx_oelib_headerProxyFactory::getInstance(); $headerProxyFactory->enableTestMode(); $this->headerCollector = $headerProxyFactory->getHeaderProxy(); $this->seminar = new tx_seminars_seminarchild($this->seminarUid); $this->fixture = tx_seminars_registrationmanager::getInstance(); $this->linkBuilder = $this->getMock('tx_seminars_Service_SingleViewLinkBuilder', array('createAbsoluteUrlForEvent')); $this->linkBuilder->expects(self::any())->method('createAbsoluteUrlForEvent')->will(self::returnValue('http://singleview.example.com/')); $this->fixture->injectLinkBuilder($this->linkBuilder); }
/** * @test */ public function hasInterestsForNonEmptyInterestsReturnsTrue() { $seminar = new tx_seminars_seminar($this->seminarUid); $this->fixture->setRegistrationData($seminar, $this->feUserUid, array('interests' => 'meeting people')); self::assertTrue($this->fixture->hasInterests()); }