protected function setUp()
 {
     $configuration = new Tx_Oelib_Configuration();
     Tx_Oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', $configuration);
     $this->extConfBackup = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'];
     $this->t3VarBackup = $GLOBALS['T3_VAR']['getUserObj'];
     $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars'] = array();
     $this->languageBackup = $GLOBALS['LANG']->lang;
     $GLOBALS['LANG']->lang = 'default';
     // Loads the locallang file for properly working localization in the tests.
     $GLOBALS['LANG']->includeLLFile('EXT:seminars/BackEnd/locallang.xml');
     tx_oelib_headerProxyFactory::getInstance()->enableTestMode();
     /** @var Tx_Oelib_MailerFactory $mailerFactory */
     $mailerFactory = t3lib_div::makeInstance('Tx_Oelib_MailerFactory');
     $mailerFactory->enableTestMode();
     $this->mailer = $mailerFactory->getMailer();
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     tx_oelib_MapperRegistry::getInstance()->activateTestingMode($this->testingFramework);
     $this->dummySysFolderUid = $this->testingFramework->createSystemFolder();
     tx_oelib_PageFinder::getInstance()->setPageUid($this->dummySysFolderUid);
     $this->organizerUid = $this->testingFramework->createRecord('tx_seminars_organizers', array('title' => 'Dummy Organizer', 'email' => '*****@*****.**'));
     $this->eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->dummySysFolderUid, 'title' => 'Dummy event', 'object_type' => tx_seminars_Model_Event::TYPE_DATE, 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] + 86400, 'organizers' => 0));
     $this->testingFramework->createRelationAndUpdateCounter('tx_seminars_seminars', $this->eventUid, $this->organizerUid, 'organizers');
     $this->fixture = new tx_seminars_BackEnd_CancelEventMailForm($this->eventUid);
     $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);
 }
 protected function setUp()
 {
     $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance();
     $configurationRegistry->set('plugin', new Tx_Oelib_Configuration());
     $this->seminarsPluginConfiguration = new Tx_Oelib_Configuration();
     $this->seminarsPluginConfiguration->setAsInteger('defaultEventVipsFeGroupID', $this->vipsGroupUid);
     $configurationRegistry->set('plugin.tx_seminars_pi1', $this->seminarsPluginConfiguration);
     $this->subject = new Tx_Seminars_Csv_FrontEndRegistrationAccessCheck();
 }
Esempio n. 3
0
 protected function setUp()
 {
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars');
     $this->subject = new tx_seminars_EmailSalutation();
     $configuration = new Tx_Oelib_Configuration();
     $configuration->setAsString('salutation', 'formal');
     Tx_Oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', $configuration);
     $this->extConfBackup = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'];
     $this->t3VarBackup = $GLOBALS['T3_VAR']['getUserObj'];
 }
Esempio n. 4
0
 protected function setUp()
 {
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars');
     $this->configuration = new Tx_Oelib_Configuration();
     $this->configuration->setAsString('timeFormat', self::TIME_FORMAT);
     Tx_Oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', $this->configuration);
     $this->translator = Tx_Oelib_TranslatorRegistry::getInstance()->get('seminars');
     $this->translatedHours = ' ' . $this->translator->translate('label_hours');
     $this->subject = new tx_seminars_ViewHelper_TimeRange();
 }
Esempio n. 5
0
 protected function setUp()
 {
     $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('seminars') . 'locallang_db.xml');
     $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('lang') . 'locallang_general.xml');
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars');
     $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance();
     $configurationRegistry->set('plugin', new Tx_Oelib_Configuration());
     $this->configuration = new Tx_Oelib_Configuration();
     $this->configuration->setData(array('charsetForCsv' => 'utf-8'));
     $configurationRegistry->set('plugin.tx_seminars', $this->configuration);
     $this->subject = new Tx_Seminars_Csv_EventListView();
 }
Esempio n. 6
0
 protected function setUp()
 {
     $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance();
     $configurationRegistry->set('config', new Tx_Oelib_Configuration());
     $configurationRegistry->set('page.config', new Tx_Oelib_Configuration());
     $configurationRegistry->set('plugin.tx_seminars._LOCAL_LANG.default', new Tx_Oelib_Configuration());
     tx_oelib_configurationProxy::getInstance('seminars')->setAsBoolean('enableConfigCheck', FALSE);
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     $this->mapper = $this->getMock('tx_seminars_Mapper_Event', array('findNextUpcoming'));
     $this->fixture = new tx_seminars_FrontEnd_Countdown(array('isStaticTemplateLoaded' => 1, 'templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html'), $GLOBALS['TSFE']->cObj);
 }
Esempio n. 7
0
 protected function setUp()
 {
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_oelib');
     $this->backEndUserBackup = $GLOBALS['BE_USER'];
     $backEndUser = new t3lib_beUserAuth();
     $backEndUser->user = array('uid' => $this->testingFramework->createBackEndUser());
     $GLOBALS['BE_USER'] = $backEndUser;
     $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance();
     $configurationRegistry->set('config', new Tx_Oelib_Configuration());
     $configurationRegistry->set('page.config', new Tx_Oelib_Configuration());
     $configurationRegistry->set('plugin.tx_oelib._LOCAL_LANG', new Tx_Oelib_Configuration());
     $configurationRegistry->set('plugin.tx_oelib._LOCAL_LANG.default', new Tx_Oelib_Configuration());
     $configurationRegistry->set('plugin.tx_oelib._LOCAL_LANG.de', new Tx_Oelib_Configuration());
     $configurationRegistry->set('plugin.tx_oelib._LOCAL_LANG.fr', new Tx_Oelib_Configuration());
 }
 protected function setUp()
 {
     $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('seminars') . 'locallang_db.xml');
     $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('lang') . 'locallang_general.xml');
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars');
     $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance();
     $configurationRegistry->set('plugin', new Tx_Oelib_Configuration());
     $this->configuration = new Tx_Oelib_Configuration();
     $this->configuration->setData(array('charsetForCsv' => 'utf-8'));
     $configurationRegistry->set('plugin.tx_seminars', $this->configuration);
     $this->pageUid = $this->testingFramework->createSystemFolder();
     $this->eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->pageUid, 'begin_date' => $GLOBALS['SIM_EXEC_TIME']));
     $this->subject = new Tx_Seminars_Csv_EmailRegistrationListView();
     $this->subject->setEventUid($this->eventUid);
 }
Esempio n. 9
0
 protected function setUp()
 {
     if (t3lib_utility_VersionNumber::convertVersionNumberToInteger(TYPO3_version) < 4007000) {
         $this->backEndConfigurationBackup = $GLOBALS['TYPO3_CONF_VARS']['BE'];
         $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] = 'utf-8';
     }
     $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('seminars') . 'locallang_db.xml');
     $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('lang') . 'locallang_general.xml');
     tx_oelib_headerProxyFactory::getInstance()->enableTestMode();
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars');
     $this->pid = $this->testingFramework->createSystemFolder();
     $this->eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->pid, 'begin_date' => $GLOBALS['SIM_EXEC_TIME']));
     $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance();
     $configurationRegistry->set('plugin', new Tx_Oelib_Configuration());
     $this->configuration = new Tx_Oelib_Configuration();
     $this->configuration->setData(array('charsetForCsv' => 'utf-8'));
     $configurationRegistry->set('plugin.tx_seminars', $this->configuration);
     $this->fixture = new tx_seminars_pi2();
     $this->fixture->init(array());
 }
Esempio n. 10
0
 protected function setUp()
 {
     $pluginConfiguration = new Tx_Oelib_Configuration();
     $pluginConfiguration->setAsString('dateFormatYMD', '%d.%m.%Y');
     $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance();
     $configurationRegistry->set('plugin.tx_seminars', $pluginConfiguration);
     $configurationRegistry->set('config', new Tx_Oelib_Configuration());
     $configurationRegistry->set('page.config', new Tx_Oelib_Configuration());
     $configurationRegistry->set('plugin.tx_seminars._LOCAL_LANG.default', new Tx_Oelib_Configuration());
     tx_oelib_configurationProxy::getInstance('seminars')->setAsBoolean('enableConfigCheck', FALSE);
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     // just picked some random date (2001-01-01 00:00:00)
     $this->eventDate = 978303600;
     $this->mapper = new tx_seminars_Mapper_Event();
     $event = $this->mapper->getLoadedTestingModel(array('pid' => 0, 'title' => 'Test event', 'begin_date' => $this->eventDate));
     $this->eventId = $event->getUid();
     $this->fixture = new tx_seminars_FrontEnd_EventHeadline(array('isStaticTemplateLoaded' => 1, 'templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html'), $GLOBALS['TSFE']->cObj);
     $this->fixture->injectEventMapper($this->mapper);
 }
 protected function setUp()
 {
     $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('seminars') . 'locallang_db.xml');
     $GLOBALS['LANG']->includeLLFile(t3lib_extMgm::extPath('lang') . 'locallang_general.xml');
     $this->testingFramework = new Tx_Oelib_TestingFramework('tx_seminars');
     $configurationRegistry = Tx_Oelib_ConfigurationRegistry::getInstance();
     $configurationRegistry->set('plugin', new Tx_Oelib_Configuration());
     $this->configuration = new Tx_Oelib_Configuration();
     $this->configuration->setData(array('charsetForCsv' => 'utf-8'));
     $configurationRegistry->set('plugin.tx_seminars', $this->configuration);
     $this->pageUid = $this->testingFramework->createSystemFolder();
     $this->eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->pageUid, 'begin_date' => $GLOBALS['SIM_EXEC_TIME']));
     $this->subject = $this->getMockForAbstractClass('Tx_Seminars_Csv_AbstractRegistrationListView');
     $this->subject->expects(self::any())->method('shouldAlsoContainRegistrationsOnQueue')->will(self::returnValue(TRUE));
     $testCase = $this;
     $this->subject->expects(self::any())->method('getFrontEndUserFieldKeys')->will(self::returnCallback(function () use($testCase) {
         return $testCase->frontEndUserFieldKeys;
     }));
     $this->subject->expects(self::any())->method('getRegistrationFieldKeys')->will(self::returnCallback(function () use($testCase) {
         return $testCase->registrationFieldKeys;
     }));
     $this->subject->setEventUid($this->eventUid);
 }
 protected function setUp()
 {
     $configuration = new Tx_Oelib_Configuration();
     Tx_Oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_seminars', $configuration);
     $this->extConfBackup = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'];
     $this->t3VarBackup = $GLOBALS['T3_VAR']['getUserObj'];
     $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['seminars'] = array();
     $this->languageBackup = $GLOBALS['LANG']->lang;
     $GLOBALS['LANG']->lang = 'default';
     // Loads the locallang file for properly working localization in the tests.
     $GLOBALS['LANG']->includeLLFile('EXT:seminars/BackEnd/locallang.xml');
     tx_oelib_headerProxyFactory::getInstance()->enableTestMode();
     /** @var Tx_Oelib_MailerFactory $mailerFactory */
     $mailerFactory = t3lib_div::makeInstance('Tx_Oelib_MailerFactory');
     $mailerFactory->enableTestMode();
     $this->mailer = $mailerFactory->getMailer();
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->dummySysFolderUid = $this->testingFramework->createSystemFolder();
     tx_oelib_PageFinder::getInstance()->setPageUid($this->dummySysFolderUid);
     $this->organizerUid = $this->testingFramework->createRecord('tx_seminars_organizers', array('title' => 'Dummy Organizer', 'email' => '*****@*****.**'));
     $this->eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('organizers' => 1, 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] + 42, 'title' => 'Dummy Event', 'registrations' => 1));
     $this->testingFramework->createRelationAndUpdateCounter('tx_seminars_seminars', $this->eventUid, $this->organizerUid, 'organizers');
     $this->fixture = new tx_seminars_BackEnd_GeneralEventMailForm($this->eventUid);
 }
Esempio n. 13
0
 /**
  * The constructor.
  */
 public function __construct()
 {
     $this->configuration = Tx_Oelib_ConfigurationRegistry::getInstance()->get('plugin.tx_seminars');
     $this->translator = Tx_Oelib_TranslatorRegistry::getInstance()->get('seminars');
 }
Esempio n. 14
0
 /**
  * @test
  */
 public function getAfterSetReturnsManuallySetConfigurationEvenIfThereIsAPage()
 {
     $pageUid = $this->testingFramework->createFrontEndPage();
     $this->testingFramework->createTemplate($pageUid, array('config' => 'plugin.tx_oelib.bar = 42'));
     Tx_Oelib_PageFinder::getInstance()->setPageUid($pageUid);
     $configuration = new Tx_Oelib_Configuration();
     Tx_Oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_oelib', $configuration);
     self::assertSame($configuration, Tx_Oelib_ConfigurationRegistry::get('plugin.tx_oelib'));
 }