Example #1
0
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     $this->fixture = new tx_seminars_FrontEnd_Editor(array(), $GLOBALS['TSFE']->cObj);
     $this->fixture->setTestMode();
 }
 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->testingFramework->createFakeFrontEnd();
     $this->systemFolderPid = $this->testingFramework->createSystemFolder();
     $this->seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->systemFolderPid, 'title' => 'Test event'));
     $this->fixture = new tx_seminars_FrontEnd_RequirementsList(array('templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html'), $GLOBALS['TSFE']->cObj);
 }
Example #4
0
 protected function setUp()
 {
     tx_oelib_configurationProxy::getInstance('seminars')->setAsBoolean('enableConfigCheck', FALSE);
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     $this->systemFolderPid = $this->testingFramework->createSystemFolder();
     $this->seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->systemFolderPid, 'title' => 'Test event'));
     $this->fixture = new tx_seminars_FrontEnd_CategoryList(array('isStaticTemplateLoaded' => 1, 'templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html', 'pages' => $this->systemFolderPid, 'pidList' => $this->systemFolderPid, 'recursive' => 1), $GLOBALS['TSFE']->cObj);
 }
 protected function setUp()
 {
     tx_oelib_configurationProxy::getInstance('seminars')->setAsBoolean('enableConfigCheck', FALSE);
     tx_oelib_headerProxyFactory::getInstance()->enableTestMode();
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     $this->seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('object_type' => tx_seminars_Model_Event::TYPE_COMPLETE, 'title' => 'Test event & more', 'attendees_max' => 10, 'needs_registration' => 1));
     $this->fixture = new tx_seminars_FrontEnd_RegistrationsList(array('templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html', 'enableRegistration' => 1), 'list_registrations', $this->seminarUid, $GLOBALS['TSFE']->cObj);
 }
Example #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);
 }
Example #7
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');
 }
 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
 /**
  * @test
  */
 public function canViewRegistrationsListMessageWithLoginAndAccessDeniedReturnsAccessDeniedMessage()
 {
     $fixture = $this->getMock('tx_seminars_seminar', array('needsRegistration', 'canViewRegistrationsList'), array(), '', FALSE);
     $fixture->expects(self::any())->method('needsRegistration')->will(self::returnValue(TRUE));
     $fixture->expects(self::any())->method('canViewRegistrationsList')->will(self::returnValue(FALSE));
     $this->testingFramework->createFakeFrontEnd();
     $this->testingFramework->createAndLoginFrontEndUser();
     self::assertSame($fixture->translate('message_accessDenied'), $fixture->canViewRegistrationsListMessage('list_registrations', 'world'));
 }
Example #10
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 #11
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);
 }
Example #12
0
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     $this->fixture = new tx_seminars_FrontEnd_PublishEvent();
 }
Example #13
0
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     $this->fixture = new tx_seminars_tests_fixtures_FrontEnd_TestingView(array('templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html'), $GLOBALS['TSFE']->cObj);
 }
 /**
  * @test
  */
 public function getContentObjectForAvailableFrontEndReturnsFrontEndContentObject()
 {
     $this->testingFramework->createFakeFrontEnd();
     $fixture = new tx_seminars_tests_fixtures_Service_TestingSingleViewLinkBuilder();
     self::assertSame($GLOBALS['TSFE']->cObj, $fixture->getContentObject());
 }
Example #15
0
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $this->testingFramework->createFakeFrontEnd();
     $this->fixture = new tx_seminars_FrontEnd_SelectorWidget(array('isStaticTemplateLoaded' => 1, 'templateFile' => 'EXT:seminars/Resources/Private/Templates/FrontEnd/FrontEnd.html'), $GLOBALS['TSFE']->cObj);
 }