コード例 #1
0
ファイル: EventEditorTest.php プロジェクト: kurtkk/seminars
 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();
 }
コード例 #2
0
 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);
 }
コード例 #3
0
 /**
  * @TODO: This is just a transitional test that can be removed once
  * createRegistration does not use the old registration model anymore.
  *
  * @test
  */
 public function createRegistrationCreatesOldAndNewRegistrationModelForTheSameUid()
 {
     // Drops the non-saving mapper so that the registration mapper (once we
     // use it) actually saves the registration.
     tx_oelib_MapperRegistry::purgeInstance();
     tx_oelib_MapperRegistry::getInstance()->activateTestingMode($this->testingFramework);
     $this->testingFramework->markTableAsDirty('tx_seminars_seminars');
     $this->createAndLogInFrontEndUser();
     $plugin = new tx_seminars_FrontEnd_DefaultController();
     $plugin->cObj = $GLOBALS['TSFE']->cObj;
     $fixture = $this->getMock('tx_seminars_registrationmanager', array('notifyAttendee', 'notifyOrganizers', 'sendAdditionalNotification', 'setRegistrationData'));
     $registration = $fixture->createRegistration($this->seminar, array(), $plugin);
     $uid = $fixture->getRegistration()->getUid();
     // @TODO: This line needs to be removed once createRegistration uses
     // the data mapper to save the registration.
     tx_oelib_db::delete('tx_seminars_attendances', 'uid = ' . $uid);
     self::assertSame($registration->getUid(), $fixture->getRegistration()->getUid());
 }
コード例 #4
0
ファイル: EventTest.php プロジェクト: Konafets/seminars
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     tx_oelib_MapperRegistry::getInstance()->activateTestingMode($this->testingFramework);
     $this->fixture = tx_oelib_MapperRegistry::get('tx_seminars_Mapper_Event');
 }