protected function setUp() { $this->deprecationLogEnabledBackup = $GLOBALS['TYPO3_CONF_VARS']['SYS']['enableDeprecationLog']; $this->testingFramework = new Tx_Oelib_TestingFramework('tx_oelib'); $this->testingFramework->createFakeFrontEnd(); $this->objectToCheck = new Tx_Oelib_Tests_Unit_Fixtures_DummyObjectToCheck(array('emptyString' => '', 'nonEmptyString' => 'foo', 'validEmail' => '*****@*****.**', 'existingColumn' => 'title', 'inexistentColumn' => 'does_not_exist')); $this->subject = new Tx_Oelib_ConfigCheck($this->objectToCheck); }
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); }
/** * @test */ public function populateListSpeakersForSetStoragePageAndUserWithSetAuxiliaryPidReturnsRecordWithAuxiliaryPid() { $pageUid = $this->testingFramework->createFrontEndPage(0, array('storage_pid' => 42)); $this->testingFramework->createFakeFrontEnd($pageUid); $this->createLoginAndAddFrontEndUserToEventEditorFrontEndGroup(array('tx_seminars_auxiliary_records_pid' => 21)); $speakerUid = $this->testingFramework->createRecord('tx_seminars_speakers', array('pid' => 21)); self::assertTrue(in_array(array('caption' => '', 'value' => $speakerUid, 'wrapitem' => '|</td><td> '), $this->fixture->populateListSpeakers(array()))); }
/** * @test */ public function createAndLoginFrontEndUserWithFrontEndUserGroupLogsInFrontEndUser() { $this->subject->createFrontEndPage(); $this->subject->createFakeFrontEnd(); $frontEndUserGroupUid = $this->subject->createFrontEndUserGroup(); $this->subject->createAndLoginFrontEndUser($frontEndUserGroupUid); self::assertTrue($this->subject->isLoggedIn()); }
/** * @test */ public function logInUserOverwritesFormerRealLoggedInUser() { $this->testingFramework->createFakeFrontEnd(); $this->testingFramework->createAndLoginFrontEndUser(); $user = new Tx_Oelib_Model_FrontEndUser(); $this->subject->logInUser($user); self::assertSame($user, $this->subject->getLoggedInUser()); }
/** * @test */ public function readsDataFromTypoScriptSetupEvenForFrontEndWithoutLoadedTemplate() { $pageUid = $this->testingFramework->createFrontEndPage(); $this->testingFramework->createTemplate($pageUid, array('config' => 'plugin.tx_oelib.test = 42')); $this->testingFramework->createFakeFrontEnd($pageUid); Tx_Oelib_PageFinder::getInstance()->forceSource(Tx_Oelib_PageFinder::SOURCE_FRONT_END); /** @var tslib_fe $frontEndController */ $frontEndController = $GLOBALS['TSFE']; $frontEndController->tmpl->rootId = 0; $frontEndController->tmpl->rootLine = FALSE; $frontEndController->tmpl->setup = array(); $frontEndController->tmpl->loaded = 0; self::assertSame(42, Tx_Oelib_ConfigurationRegistry::get('plugin.tx_oelib')->getAsInteger('test')); }
/** * @test */ public function getByExtensionNameDoesNotDeleteLanguageLabelsNotAffectedByTypoScript() { $testingFramework = new Tx_Oelib_TestingFramework('oelib'); $testingFramework->createFakeFrontEnd(); $this->getFrontEndController()->initLLvars(); Tx_Oelib_ConfigurationRegistry::get('config')->set('language', 'default'); Tx_Oelib_ConfigurationRegistry::get('plugin.tx_oelib._LOCAL_LANG')->setData(array('default.' => array())); Tx_Oelib_ConfigurationRegistry::get('plugin.tx_oelib._LOCAL_LANG.default')->set('label_test_2', 'I am from TypoScript.'); self::assertSame('I am from file.', Tx_Oelib_TranslatorRegistry::get('oelib')->translate('label_test')); $testingFramework->discardFakeFrontEnd(); }
/** * @test */ public function getCurrentSourceForSetFrontEndPageUidReturnsSourceFrontEnd() { $this->testingFramework->createFakeFrontEnd(); self::assertSame(Tx_Oelib_PageFinder::SOURCE_FRONT_END, $this->subject->getCurrentSource()); }
protected function setUp() { $this->testingFramework = new Tx_Oelib_TestingFramework('tx_oelib'); $this->testingFramework->createFakeFrontEnd(); $this->subject = new Tx_Oelib_Tests_Unit_Fixtures_TestingSalutationSwitcher(array()); }
/** * @test */ public function hasStoragePidForGrspSetReturnsTrue() { $pageUid = $this->testingFramework->createFrontEndPage(0, array('storage_pid' => 42)); $this->testingFramework->createFakeFrontEnd($pageUid); self::assertTrue($this->subject->hasStoragePid()); }