當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GeneralUtility::getSingletonInstances方法代碼示例

本文整理匯總了PHP中TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances方法的典型用法代碼示例。如果您正苦於以下問題:PHP GeneralUtility::getSingletonInstances方法的具體用法?PHP GeneralUtility::getSingletonInstances怎麽用?PHP GeneralUtility::getSingletonInstances使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TYPO3\CMS\Core\Utility\GeneralUtility的用法示例。


在下文中一共展示了GeneralUtility::getSingletonInstances方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setUp

 /**
  * Set up
  */
 public function setUp()
 {
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $GLOBALS['BE_USER'] = $this->getMock('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication', array('getSessionData', 'setAndSaveSessionData'));
     $GLOBALS['BE_USER']->user['uid'] = 1;
     $this->subject = $this->getAccessibleMock('TYPO3\\CMS\\Core\\FormProtection\\BackendFormProtection', array('acquireLock', 'releaseLock', 'getLanguageService', 'isAjaxRequest'));
 }
開發者ID:khanhdeux,項目名稱:typo3test,代碼行數:10,代碼來源:BackendFormProtectionTest.php

示例2: setUp

 public function setUp()
 {
     $this->createAccessibleProxyClass();
     $this->globals = array('TYPO3_LOADED_EXT' => serialize($GLOBALS['TYPO3_LOADED_EXT']));
     $this->testFilesToDelete = array();
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
 }
開發者ID:nicksergio,項目名稱:TYPO3v4-Core,代碼行數:7,代碼來源:ExtensionMangementUtilityTest.php

示例3: setUp

 public function setUp()
 {
     $this->singletonInstances = GeneralUtility::getSingletonInstances();
     $this->createAccessibleProxyClass();
     $this->backUpPackageManager = ExtensionManagementUtilityAccessibleProxy::getPackageManager();
     $this->singletonInstances = GeneralUtility::getSingletonInstances();
 }
開發者ID:Mr-Robota,項目名稱:TYPO3.CMS,代碼行數:7,代碼來源:ExtensionManagementUtilityTest.php

示例4: setUp

 /**
  * Sets up this test suite.
  */
 protected function setUp()
 {
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $this->filter = new \TYPO3\CMS\Core\Resource\Filter\FileExtensionFilter();
     $this->tceMainMock = $this->getMock(\TYPO3\CMS\Core\DataHandling\DataHandler::class, array('deleteAction'), array());
     $this->fileFactoryMock = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceFactory::class, array('getFileReferenceObject'), array());
     \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Resource\ResourceFactory::class, $this->fileFactoryMock);
 }
開發者ID:plan2net,項目名稱:TYPO3.CMS,代碼行數:11,代碼來源:FileExtensionFilterTest.php

示例5: setUp

 /**
  * Set up
  */
 protected function setUp()
 {
     if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('scheduler')) {
         $this->markTestSkipped('Tests need EXT:scheduler loaded.');
     }
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $this->repositoryHelper = $this->getMock(\TYPO3\CMS\Extensionmanager\Utility\Repository\Helper::class, array(), array(), '', FALSE);
 }
開發者ID:plan2net,項目名稱:TYPO3.CMS,代碼行數:11,代碼來源:UpdateExtensionListTaskTest.php

示例6: setUp

 public function setUp()
 {
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $this->databaseBackup = $GLOBALS['TYPO3_DB'];
     $this->backEndUser = $this->getMock('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication');
     $this->fixture = new \TYPO3\CMS\Core\DataHandling\DataHandler();
     $this->fixture->start(array(), '', $this->backEndUser);
 }
開發者ID:nicksergio,項目名稱:TYPO3v4-Core,代碼行數:8,代碼來源:DataHandlerTest.php

示例7: setUp

 public function setUp()
 {
     $GLOBALS['TCA'] = array();
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $this->backEndUser = $this->getMock('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication');
     $this->subject = new \TYPO3\CMS\Core\DataHandling\DataHandler();
     $this->subject->start(array(), '', $this->backEndUser);
 }
開發者ID:Mr-Robota,項目名稱:TYPO3.CMS,代碼行數:8,代碼來源:DataHandlerTest.php

示例8: setUp

 public function setUp()
 {
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $this->createAccessibleProxyClass();
     $this->testFilesToDelete = array();
     $this->backUpPackageManager = ExtensionManagementUtilityAccessibleProxy::getPackageManager();
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
 }
開發者ID:KarlDennisMatthaei1923,項目名稱:PierraaDesign,代碼行數:8,代碼來源:ExtensionManagementUtilityTest.php

示例9: setUp

 protected function setUp()
 {
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $this->storageMock = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceStorage::class, array(), array(), '', false);
     $this->storageMock->expects($this->any())->method('getUid')->will($this->returnValue(5));
     $mockedMetaDataRepository = $this->getMock(\TYPO3\CMS\Core\Resource\Index\MetaDataRepository::class);
     $mockedMetaDataRepository->expects($this->any())->method('findByFile')->will($this->returnValue(array('file' => 1)));
     \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance(\TYPO3\CMS\Core\Resource\Index\MetaDataRepository::class, $mockedMetaDataRepository);
 }
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:9,代碼來源:FileTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     // use a mocked file repository to avoid updating the index when doing property update tests
     $mockedRepository = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileRepository');
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     \TYPO3\CMS\Core\Utility\GeneralUtility::purgeInstances();
     \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository', $mockedRepository);
 }
開發者ID:nicksergio,項目名稱:TYPO3v4-Core,代碼行數:9,代碼來源:LocalDriverTest.php

示例11: setUp

 public function setUp()
 {
     parent::setUp();
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Resource\\FileRepository', $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileRepository'));
     $databaseMock = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
     $databaseMock->expects($this->any())->method('exec_SELECTgetRows')->with('*', 'sys_file_storage', '1=1', '', 'name', '', 'uid')->willReturn(array());
     $GLOBALS['TYPO3_DB'] = $databaseMock;
 }
開發者ID:khanhdeux,項目名稱:typo3test,代碼行數:9,代碼來源:ResourceStorageTest.php

示例12: setUp

 public function setUp()
 {
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $this->storageMock = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceStorage', array(), array(), '', FALSE);
     $this->storageMock->expects($this->any())->method('getUid')->will($this->returnValue(5));
     $mockedMetaDataRepository = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Index\\MetaDataRepository');
     $mockedMetaDataRepository->expects($this->any())->method('findByFile')->will($this->returnValue(array('file' => 1)));
     \TYPO3\CMS\Core\Utility\GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Core\\Resource\\Index\\MetaDataRepository', $mockedMetaDataRepository);
 }
開發者ID:khanhdeux,項目名稱:typo3test,代碼行數:9,代碼來源:FileTest.php

示例13: setUp

 /**
  * Set up
  */
 protected function setUp()
 {
     $this->singletonInstances = GeneralUtility::getSingletonInstances();
     $this->contentObjectRenderer = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
     $this->subject = $this->getAccessibleMock(\TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::class, array('initializeStandaloneViewInstance'), array($this->contentObjectRenderer));
     /** @var $tsfe \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
     $tsfe = $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array(), array(), '', false);
     $tsfe->tmpl = $this->getMock(\TYPO3\CMS\Core\TypoScript\TemplateService::class);
     $GLOBALS['TSFE'] = $tsfe;
 }
開發者ID:graurus,項目名稱:testgit_t37,代碼行數:13,代碼來源:FluidTemplateContentObjectTest.php

示例14: setUp

 /**
  * Set up the tests
  */
 protected function setUp()
 {
     $GLOBALS['TCA'] = array();
     $this->singletonInstances = GeneralUtility::getSingletonInstances();
     $this->backEndUser = $this->getMock(BackendUserAuthentication::class);
     $this->mockDatabaseConnection = $this->getMock(DatabaseConnection::class, array(), array(), '', FALSE);
     $GLOBALS['TYPO3_DB'] = $this->mockDatabaseConnection;
     $this->subject = $this->getAccessibleMock(DataHandler::class, ['dummy']);
     $this->subject->start(array(), '', $this->backEndUser);
 }
開發者ID:plan2net,項目名稱:TYPO3.CMS,代碼行數:13,代碼來源:DataHandlerTest.php

示例15: setUp

 /**
  * Set up
  */
 public function setUp()
 {
     $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
     $this->contentObjectRenderer = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
     $this->fixture = $this->getAccessibleMock('TYPO3\\CMS\\Frontend\\ContentObject\\FluidTemplateContentObject', array('dummy', 'initializeStandaloneViewInstance'), array($this->contentObjectRenderer));
     /** @var $tsfe \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
     $tsfe = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(), '', FALSE);
     $tsfe->tmpl = $this->getMock('TYPO3\\CMS\\Core\\TypoScript\\TemplateService');
     $GLOBALS['TSFE'] = $tsfe;
 }
開發者ID:Mr-Robota,項目名稱:TYPO3.CMS,代碼行數:13,代碼來源:FluidTemplateContentObjectTest.php


注:本文中的TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。