本文整理汇总了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'));
}
示例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();
}
示例3: setUp
public function setUp()
{
$this->singletonInstances = GeneralUtility::getSingletonInstances();
$this->createAccessibleProxyClass();
$this->backUpPackageManager = ExtensionManagementUtilityAccessibleProxy::getPackageManager();
$this->singletonInstances = GeneralUtility::getSingletonInstances();
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}