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;
 }
Example #2
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();
 }
Example #3
0
 /**
  * @test
  */
 public function renderWithTimeSpanWithBeginAndEndDateOnDifferentDaysWithAbbreviateDateRangeFalseReturnsBothFullDatesSeparatedBySpecifiedDash()
 {
     $this->configuration->setAsBoolean('abbreviateDateRanges', FALSE);
     $dash = '#DASH#';
     $timeSpan = new tx_seminars_tests_fixtures_TestingTimeSpan();
     $timeSpan->setBeginDateAsUnixTimeStamp(self::BEGIN_DATE);
     $endDate = self::BEGIN_DATE + 2 * 86400;
     $timeSpan->setEndDateAsUnixTimeStamp($endDate);
     self::assertEquals(strftime(self::DATE_FORMAT_YMD, self::BEGIN_DATE) . $dash . strftime(self::DATE_FORMAT_YMD, $endDate), $this->fixture->render($timeSpan, $dash));
 }
Example #4
0
 /**
  * @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());
 }
Example #5
0
 /**
  * Renders a UNIX timestamp in the strftime format specified in plugin.tx_seminars_seminars.dateFormatD.
  *
  * @param int $timestamp the UNIX timestamp to render
  *
  * @return string the UNIX timestamp rendered using the strftime format in plugin.tx_seminars_seminars.dateFormatD
  */
 protected function getAsDateFormatD($timestamp)
 {
     return strftime($this->configuration->getAsString('dateFormatD'), $timestamp);
 }
Example #6
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());
 }