Exemplo n.º 1
0
 /**
  * @test
  */
 public function extensionStaticsAreProcessedIfExplicitlyRequested()
 {
     $identifier = uniqid('test');
     $GLOBALS['TYPO3_LOADED_EXT'] = array($identifier => array('ext_typoscript_setup.txt' => ExtensionManagementUtility::extPath('core', 'Tests/Unit/TypoScript/Fixtures/ext_typoscript_setup.txt'), 'ext_typoscript_constants.txt' => ''));
     $mockPackage = $this->getMock('TYPO3\\CMS\\Core\\Package\\Package', array('getPackagePath'), array(), '', FALSE);
     $mockPackage->expects($this->any())->method('getPackagePath')->will($this->returnValue(''));
     $mockPackageManager = $this->getMock('TYPO3\\CMS\\Core\\Package\\PackageManager', array('isPackageActive', 'getPackage'));
     $mockPackageManager->expects($this->any())->method('isPackageActive')->will($this->returnValue(TRUE));
     $mockPackageManager->expects($this->any())->method('getPackage')->will($this->returnValue($mockPackage));
     ExtensionManagementUtility::setPackageManager($mockPackageManager);
     $this->templateService->setProcessExtensionStatics(TRUE);
     $this->templateService->runThroughTemplates(array(), 0);
     $this->assertTrue(in_array('test.Core.TypoScript = 1', $this->templateService->config));
     ExtensionManagementUtility::setPackageManager(GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Package\\PackageManager'));
 }