Exemple #1
0
 /**
  * @test
  */
 public function getCurrentSourceForSetBackEndPageUidReturnsSourceBackEnd()
 {
     $_POST['id'] = 42;
     $pageSource = $this->subject->getCurrentSource();
     unset($_POST['id']);
     self::assertSame(Tx_Oelib_PageFinder::SOURCE_BACK_END, $pageSource);
 }
 /**
  * Cleans up oelib after running a test.
  *
  * @return void
  */
 public function cleanUp()
 {
     Tx_Oelib_ConfigurationProxy::purgeInstances();
     Tx_Oelib_BackEndLoginManager::purgeInstance();
     Tx_Oelib_ConfigurationRegistry::purgeInstance();
     Tx_Oelib_FrontEndLoginManager::purgeInstance();
     tx_oelib_Geocoding_Google::purgeInstance();
     tx_oelib_headerProxyFactory::purgeInstance();
     Tx_Oelib_MapperRegistry::purgeInstance();
     Tx_Oelib_PageFinder::purgeInstance();
     Tx_Oelib_Session::purgeInstances();
     Tx_Oelib_TemplateHelper::purgeCachedConfigurations();
     Tx_Oelib_TranslatorRegistry::purgeInstance();
     /** @var Tx_Oelib_MailerFactory $mailerFactory */
     $mailerFactory = t3lib_div::makeInstance('Tx_Oelib_MailerFactory');
     $mailerFactory->cleanUp();
 }
Exemple #3
0
 /**
  * Purges the current instance so that getInstance will create a new instance.
  *
  * @return void
  */
 public static function purgeInstance()
 {
     self::$instance = NULL;
 }
Exemple #4
0
 /**
  * Gets the ID of the currently selected back-end page.
  *
  * @return int the current back-end page ID (or 0 if there is an
  *                 error)
  */
 public function getCurrentBePageId()
 {
     return Tx_Oelib_PageFinder::getInstance()->getPageUid();
 }
 /**
  * @test
  */
 public function getAfterSetReturnsManuallySetConfigurationEvenIfThereIsAPage()
 {
     $pageUid = $this->testingFramework->createFrontEndPage();
     $this->testingFramework->createTemplate($pageUid, array('config' => 'plugin.tx_oelib.bar = 42'));
     Tx_Oelib_PageFinder::getInstance()->setPageUid($pageUid);
     $configuration = new Tx_Oelib_Configuration();
     Tx_Oelib_ConfigurationRegistry::getInstance()->set('plugin.tx_oelib', $configuration);
     self::assertSame($configuration, Tx_Oelib_ConfigurationRegistry::get('plugin.tx_oelib'));
 }
 /**
  * Retrieves the complete TypoScript setup for the current page as a nested
  * array.
  *
  * @return array the TypoScriptSetup for the current page, will be empty if
  *               no page is selected or if the TS setup of the page is empty
  */
 private function getCompleteTypoScriptSetup()
 {
     $pageUid = Tx_Oelib_PageFinder::getInstance()->getPageUid();
     if ($pageUid === 0) {
         return array();
     }
     if ($this->existsFrontEnd()) {
         return $this->getFrontEndController()->tmpl->setup;
     }
     /** @var t3lib_TStemplate $template */
     $template = t3lib_div::makeInstance('t3lib_TStemplate');
     $template->tt_track = 0;
     $template->init();
     /** @var t3lib_pageSelect $page */
     $page = t3lib_div::makeInstance('t3lib_pageSelect');
     $rootline = $page->getRootLine($pageUid);
     $template->runThroughTemplates($rootline, 0);
     $template->generateConfig();
     return $template->setup;
 }