protected function setUp()
 {
     tx_oelib_configurationProxy::getInstance('seminars')->setAsBoolean('enableConfigCheck', FALSE);
     $this->extConfBackup = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'];
     $this->t3VarBackup = $GLOBALS['T3_VAR']['getUserObj'];
     $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars'] = array();
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     tx_oelib_headerProxyFactory::getInstance()->enableTestMode();
     $configuration = new tx_oelib_Configuration();
     $configuration->setAsString('currency', 'EUR');
     tx_oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', $configuration);
     $this->systemFolderPid = $this->testingFramework->createSystemFolder();
     $this->seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->systemFolderPid, 'title' => 'Test & event', 'subtitle' => 'Something for you & me', 'accreditation_number' => '1 & 1', 'room' => 'Rooms 2 & 3'));
     $this->fixture = new tx_seminars_FrontEnd_DefaultController();
     $this->fixture->init(array('isStaticTemplateLoaded' => 1, 'enableRegistration' => 1, 'templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html', 'what_to_display' => 'seminar_list', 'pidList' => $this->systemFolderPid, 'pages' => $this->systemFolderPid, 'recursive' => 1, 'listView.' => array('orderBy' => 'data', 'descFlag' => 0, 'results_at_a_time' => 999, 'maxPages' => 5), 'eventFieldsOnRegistrationPage' => 'title,price_regular,price_special,vacancies,accreditation_number', 'linkToSingleView' => 'always'));
     $this->fixture->getTemplateCode();
     $this->fixture->setLabels();
     $this->fixture->createHelperObjects();
     tx_oelib_templatehelper::setCachedConfigurationValue('dateFormatYMD', '%d.%m.%Y');
     tx_oelib_templatehelper::setCachedConfigurationValue('timeFormat', '%H:%M');
     $this->linkBuilder = $this->getMock('tx_seminars_Service_SingleViewLinkBuilder', array('createRelativeUrlForEvent'));
     $this->linkBuilder->expects(self::any())->method('createRelativeUrlForEvent')->will(self::returnValue('index.php?id=42&tx_seminars_pi1%5BshowUid%5D=1337'));
     $this->fixture->injectLinkBuilder($this->linkBuilder);
     /** @var $content tslib_cObj|PHPUnit_Framework_MockObject_MockObject */
     $content = $this->getMock('tslib_cObj', array('IMAGE'));
     $content->expects(self::any())->method('IMAGE')->will(self::returnValue('<img src="foo.jpg" alt="bar"/>'));
     $this->fixture->cObj = $content;
 }
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->postBackup = $_POST;
     $this->getBackup = $_GET;
     $this->typo3confVarsBackup = $GLOBALS['TYPO3_CONF_VARS'];
     tx_oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars_pi1', new tx_oelib_Configuration());
 }
Example #3
0
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->configuration = new tx_oelib_Configuration();
     $this->configuration->setAsString('dateFormatYMD', self::DATE_FORMAT_YMD);
     $this->configuration->setAsString('dateFormatY', self::DATE_FORMAT_Y);
     $this->configuration->setAsString('dateFormatM', self::DATE_FORMAT_M);
     $this->configuration->setAsString('dateFormatMD', self::DATE_FORMAT_MD);
     $this->configuration->setAsString('dateFormatD', self::DATE_FORMAT_D);
     tx_oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', $this->configuration);
     $this->translator = tx_oelib_TranslatorRegistry::getInstance()->get('seminars');
     $this->fixture = new tx_seminars_ViewHelper_DateRange();
 }
Example #4
0
 protected function setUp()
 {
     tx_seminars_registrationchild::purgeCachedSeminars();
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     tx_oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', new tx_oelib_Configuration());
     $organizerUid = $this->testingFramework->createRecord('tx_seminars_organizers', array('title' => 'test organizer', 'email' => '*****@*****.**'));
     $this->seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('organizers' => 1, 'title' => 'foo_event'));
     $this->testingFramework->createRelation('tx_seminars_seminars_organizers_mm', $this->seminarUid, $organizerUid);
     $this->feUserUid = $this->testingFramework->createFrontEndUser('', array('name' => 'foo_user', 'email' => '*****@*****.**'));
     $this->registrationUid = $this->testingFramework->createRecord('tx_seminars_attendances', array('title' => 'test title', 'seminar' => $this->seminarUid, 'interests' => 'nothing', 'expectations' => '', 'background_knowledge' => 'foo' . LF . 'bar', 'known_from' => 'foo' . CR . 'bar', 'user' => $this->feUserUid));
     $this->fixture = new tx_seminars_registrationchild($this->registrationUid);
     $this->fixture->setConfigurationValue('templateFile', 'EXT:seminars/Resources/Private/Templates/Mail/e-mail.html');
 }
Example #5
0
 protected function setUp()
 {
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     tx_oelib_MapperRegistry::getInstance()->activateTestingMode($this->testingFramework);
     tx_oelib_configurationProxy::getInstance('seminars')->setAsBoolean('useStoragePid', FALSE);
     $this->configuration = new tx_oelib_Configuration();
     $this->configuration->setAsInteger('createAuxiliaryRecordsPID', 0);
     tx_oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars_pi1', $this->configuration);
     $this->fixture = new tx_seminars_FrontEnd_EventEditor(array('templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html', 'form.' => array('eventEditor.' => array())), $GLOBALS['TSFE']->cObj);
     $this->fixture->setTestMode();
     /** @var Tx_Oelib_MailerFactory $mailerFactory */
     $mailerFactory = t3lib_div::makeInstance('Tx_Oelib_MailerFactory');
     $mailerFactory->enableTestMode();
     $this->mailer = $mailerFactory->getMailer();
 }
Example #6
0
 protected function setUp()
 {
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars');
     /** @var Tx_Oelib_MailerFactory $mailerFactory */
     $mailerFactory = t3lib_div::makeInstance('Tx_Oelib_MailerFactory');
     $mailerFactory->enableTestMode();
     $this->mailer = $mailerFactory->getMailer();
     define('TYPO3_cliKey', 'seminars');
     $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['cliKeys'][TYPO3_cliKey][1] = '_cli_seminars_test';
     $this->testingFramework->createBackEndUser(array('username' => '_cli_seminars_test'));
     tx_oelib_ConfigurationRegistry::getInstance()->set('plugin', new Tx_Oelib_Configuration());
     $this->configuration = new Tx_Oelib_Configuration();
     $this->configuration->setData(array('sendEventTakesPlaceReminderDaysBeforeBeginDate' => 2, 'sendCancelationDeadlineReminder' => TRUE, 'filenameForRegistrationsCsv' => 'registrations.csv', 'dateFormatYMD' => '%d.%m.%Y', 'fieldsFromAttendanceForEmailCsv' => 'title', 'showAttendancesOnRegistrationQueueInEmailCsv' => TRUE));
     tx_oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', $this->configuration);
     $this->fixture = new tx_seminars_cli_MailNotifier();
 }
Example #7
0
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $frontEndPageUid = $this->testingFramework->createFrontEndPage();
     $this->testingFramework->createFakeFrontEnd($frontEndPageUid);
     $this->session = new tx_oelib_FakeSession();
     tx_oelib_Session::setInstance(tx_oelib_Session::TYPE_USER, $this->session);
     $configurationRegistry = tx_oelib_ConfigurationRegistry::getInstance();
     $configuration = new tx_oelib_Configuration();
     $configuration->setAsString('currency', 'EUR');
     $configurationRegistry->set('plugin.tx_seminars', $configuration);
     $configurationRegistry->set('plugin.tx_staticinfotables_pi1', new tx_oelib_Configuration());
     $this->seminar = new tx_seminars_seminar($this->testingFramework->createRecord('tx_seminars_seminars', array('payment_methods' => '1')));
     $this->seminarUid = $this->seminar->getUid();
     $this->fixture = new tx_seminars_FrontEnd_RegistrationForm(array('pageToShowAfterUnregistrationPID' => $frontEndPageUid, 'sendParametersToThankYouAfterRegistrationPageUrl' => 1, 'thankYouAfterRegistrationPID' => $frontEndPageUid, 'sendParametersToPageToShowAfterUnregistrationUrl' => 1, 'templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html', 'logOutOneTimeAccountsAfterRegistration' => 1, 'showRegistrationFields' => 'registered_themselves,attendees_names', 'showFeUserFieldsInRegistrationForm' => 'name,email', 'showFeUserFieldsInRegistrationFormWithLabel' => 'email', 'form.' => array('unregistration.' => array(), 'registration.' => array('step1.' => array(), 'step2.' => array()))), $GLOBALS['TSFE']->cObj);
     $this->fixture->setAction('register');
     $this->fixture->setSeminar($this->seminar);
     $this->fixture->setTestMode();
 }
 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);
 }
Example #9
0
 /**
  * The constructor.
  */
 public function __construct()
 {
     $this->configuration = tx_oelib_ConfigurationRegistry::getInstance()->get('plugin.tx_seminars');
     $this->translator = tx_oelib_TranslatorRegistry::getInstance()->get('seminars');
 }
Example #10
0
 /**
  * @test
  */
 public function renderWithUidOfExistingEventReturnsDateOfSelectedEvent()
 {
     $dateFormat = '%d.%m.%Y';
     $configuration = new tx_oelib_Configuration();
     $configuration->setAsString('dateFormatYMD', $dateFormat);
     tx_oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars_seminars', $configuration);
     $this->fixture->piVars['uid'] = $this->eventId;
     self::assertContains(strftime($dateFormat, $this->eventDate), $this->fixture->render());
 }