Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 protected function setUp()
 {
     $this->testingFramework = new tx_oelib_testingFramework('tx_seminars');
     $systemFolderUid = $this->testingFramework->createSystemFolder();
     $this->testingFramework->createTemplate($systemFolderUid, array('tstamp' => $GLOBALS['SIM_EXEC_TIME'], 'sorting' => 256, 'crdate' => $GLOBALS['SIM_EXEC_TIME'], 'cruser_id' => 1, 'title' => 'TEST', 'root' => 1, 'clear' => 3, 'include_static_file' => 'EXT:seminars/Configuration/TypoScript/'));
     $this->fixtureUid = $this->testingFramework->createRecord('tx_seminars_test', array('pid' => $systemFolderUid, 'title' => 'Test'));
     $this->fixture = new tx_seminars_tests_fixtures_OldModel_Testing($this->fixtureUid);
 }
Ejemplo n.º 3
0
 /**
  * @test
  */
 public function getEntriesFromGeneralStoragePageForUseStoragePidNotAndStoragePidSetFindsRecordWithPidOtherThanStoragePid()
 {
     $sysFolderUid = $this->testingFramework->createSystemFolder(0, array('storage_pid' => $this->testingFramework->createSystemFolder()));
     $recordUid = $this->testingFramework->createRecord($this->testingTable, array('title' => 'foo record', 'pid' => 42));
     $configuration = $this->fixture->getEntriesFromGeneralStoragePage(array('config' => array('itemTable' => $this->testingTable), 'row' => array('pid' => $sysFolderUid), 'items' => array()));
     self::assertTrue(in_array(array(0 => 'foo record', 1 => $recordUid, 2 => 'fooicon'), $configuration['items']));
 }
Ejemplo n.º 4
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);
 }
Ejemplo n.º 5
0
 /**
  * @test
  */
 public function showContainsRegistrationFromSubfolder()
 {
     $subfolderPid = $this->testingFramework->createSystemFolder($this->dummySysFolderPid);
     $seminarUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $this->dummySysFolderPid, 'title' => 'event for registration in subfolder'));
     $this->testingFramework->createRecord('tx_seminars_attendances', array('pid' => $subfolderPid, 'seminar' => $seminarUid));
     self::assertContains('event for registration in subfolder', $this->fixture->show());
 }
Ejemplo n.º 6
0
 public function testRenderCanReadFromAllSystemFolders()
 {
     $this->fixture->setConfigurationValue('pages', '');
     $otherSystemFolderUid = $this->testingFramework->createSystemFolder();
     $categoryUid = $this->testingFramework->createRecord('tx_seminars_categories', array('title' => 'one category'));
     $eventUid = $this->testingFramework->createRecord('tx_seminars_seminars', array('pid' => $otherSystemFolderUid, 'title' => 'my title', 'begin_date' => $GLOBALS['SIM_EXEC_TIME'] + 1000, 'categories' => 1));
     $this->testingFramework->createRelation('tx_seminars_seminars_categories_mm', $eventUid, $categoryUid);
     self::assertContains('one category', $this->fixture->render());
 }
Ejemplo n.º 7
0
 public function testBuilderIgnoresRecordsOnSubpageWithTooShallowRecursion()
 {
     $subPagePid = $this->testingFramework->createSystemFolder($this->dummySysFolderPid);
     $subSubPagePid = $this->testingFramework->createSystemFolder($subPagePid);
     $this->testingFramework->createRecord('tx_seminars_test', array('pid' => $subSubPagePid));
     $this->fixture->setSourcePages($this->dummySysFolderPid, 1);
     $bag = $this->fixture->build();
     self::assertTrue($bag->isEmpty());
 }
Ejemplo n.º 8
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');
     $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);
 }
Ejemplo n.º 9
0
 public function testResultCounterIsZeroForNoResults()
 {
     $this->fixture->setConfigurationValue('pidList', $this->testingFramework->createSystemFolder());
     $this->fixture->main('', array());
     self::assertEquals(0, $this->fixture->internal['res_count']);
 }
Ejemplo n.º 10
0
 /**
  * @test
  */
 public function showContainsSpeakerFromSubfolder()
 {
     $subfolderPid = $this->testingFramework->createSystemFolder($this->dummySysFolderPid);
     $this->testingFramework->createRecord('tx_seminars_speakers', array('title' => 'Speaker in subfolder', 'pid' => $subfolderPid));
     self::assertContains('Speaker in subfolder', $this->fixture->show());
 }
Ejemplo n.º 11
0
 /**
  * @test
  */
 public function dumpUserValuesDoesNotContainRawLabelNameAsLabelForPid()
 {
     $pid = $this->testingFramework->createSystemFolder();
     $this->fixture->setUserData(array('pid' => $pid));
     self::assertNotContains('label_pid', $this->fixture->dumpUserValues('pid'));
 }