Commit 6190776d authored by Stefan Neufeind's avatar Stefan Neufeind Committed by Markus Klein
Browse files

[TASK] Use name-resolution instead of strings where possible: 11

(part for EXT:backend)

Use name-resolution with ...::class instead of strings where
possible.
(needs PHP 5.5, which is meanwhile required for master)

Change-set Iedbb896607adddce2b23ab67f990fa2296c0d1bb
first introduced usage of ::class in master. We now add it
in various more places.

Change-Id: I49f47b7fb3dbee281af8e166afc3c36662730b54
Resolves: #63477
Releases: master
Reviewed-on: http://review.typo3.org/34867


Reviewed-by: default avatarFrank Nägler <typo3@naegler.net>
Tested-by: default avatarFrank Nägler <typo3@naegler.net>
Reviewed-by: default avatarMarkus Klein <klein.t3@reelworx.at>
Tested-by: default avatarMarkus Klein <klein.t3@reelworx.at>
parent 84909ef1
......@@ -93,7 +93,7 @@ class ClearCacheToolbarItem implements ToolbarItemInterface {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['additionalBackendItems']['cacheActions'] as $cacheAction) {
$hookObject = GeneralUtility::getUserObj($cacheAction);
if (!$hookObject instanceof ClearCacheActionsHookInterface) {
throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Backend\\Toolbar\\ClearCacheActionsHookInterface', 1228262000);
throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Backend\Toolbar\ClearCacheActionsHookInterface::class, 1228262000);
}
$hookObject->manipulateCacheActions($this->cacheActions, $this->optionValues);
}
......
......@@ -182,7 +182,7 @@ class MoveElementController {
// Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
// SHARED page-TSconfig settings.
$modTSconfig_SHARED = BackendUtility::getModTSconfig($this->page_id, 'mod.SHARED');
$colPosArray = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getColPosListItemsParsed', $this->page_id, $this);
$colPosArray = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $this->page_id, $this);
$colPosIds = array();
foreach ($colPosArray as $colPos) {
$colPosIds[] = $colPos[1];
......
......@@ -176,7 +176,7 @@ class NewContentElementController {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms']['db_new_content_el']['wizardItemsHook'] as $classData) {
$hookObject = GeneralUtility::getUserObj($classData);
if (!$hookObject instanceof \TYPO3\CMS\Backend\Wizard\NewContentElementWizardHookInterface) {
throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Backend\\Wizard\\NewContentElementWizardHookInterface', 1227834741);
throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Backend\Wizard\NewContentElementWizardHookInterface::class, 1227834741);
}
$hookObject->manipulateWizardItems($wizardItems, $this);
}
......@@ -264,7 +264,7 @@ class NewContentElementController {
$code = $GLOBALS['LANG']->getLL('sel2', 1) . '<br /><br />';
// Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
$colPosArray = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getColPosListItemsParsed', $this->id, $this);
$colPosArray = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $this->id, $this);
$colPosIds = array_column($colPosArray, 1);
// Removing duplicates, if any
$colPosList = implode(',', array_unique(array_map('intval', $colPosIds)));
......
......@@ -617,7 +617,7 @@ class LoginController {
* @return array Modified markers array
*/
protected function emitRenderLoginFormSignal(array $markers) {
$signalArguments = $this->getSignalSlotDispatcher()->dispatch('TYPO3\\CMS\\Backend\\Controller\\LoginController', self::SIGNAL_RenderLoginForm, array($this, $markers));
$signalArguments = $this->getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Backend\Controller\LoginController::class, self::SIGNAL_RenderLoginForm, array($this, $markers));
return $signalArguments[1];
}
......
......@@ -556,7 +556,7 @@ class PageLayoutController {
$this->topFuncMenu = BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function'], 'db_layout.php', '');
$this->languageMenu = count($this->MOD_MENU['language']) > 1 ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_general.xlf:LGL.language', TRUE) . BackendUtility::getFuncMenu($this->id, 'SET[language]', $this->current_sys_language, $this->MOD_MENU['language'], 'db_layout.php', '') : '';
// Find backend layout / coumns
$backendLayout = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getSelectedBackendLayout', $this->id, $this);
$backendLayout = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getSelectedBackendLayout', $this->id, $this);
if (count($backendLayout['__colPosList'])) {
$this->colPosList = implode(',', $backendLayout['__colPosList']);
}
......@@ -964,7 +964,7 @@ class PageLayoutController {
// Setting up the tt_content columns to show:
if (is_array($GLOBALS['TCA']['tt_content']['columns']['colPos']['config']['items'])) {
$colList = array();
$tcaItems = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getColPosListItemsParsed', $this->id, $this);
$tcaItems = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $this->id, $this);
foreach ($tcaItems as $temp) {
$colList[] = $temp[1];
}
......
......@@ -150,7 +150,7 @@ class InlineElement {
foreach ($tceformsInlineHook as $classData) {
$processObject = GeneralUtility::getUserObj($classData);
if (!$processObject instanceof \TYPO3\CMS\Backend\Form\Element\InlineElementHookInterface) {
throw new \UnexpectedValueException('$processObject must implement interface TYPO3\\CMS\\Backend\\Form\\Element\\InlineElementHookInterface', 1202072000);
throw new \UnexpectedValueException('$processObject must implement interface ' . \TYPO3\CMS\Backend\Form\Element\InlineElementHookInterface::class, 1202072000);
}
$processObject->init($this);
$this->hookObjects[] = $processObject;
......
......@@ -273,7 +273,7 @@ class SuggestElement {
// instantiate the class that should fetch the records for this $queryTable
$receiverClassName = $config['receiverClass'];
if (!class_exists($receiverClassName)) {
$receiverClassName = 'TYPO3\\CMS\\Backend\\Form\\Element\\SuggestDefaultReceiver';
$receiverClassName = \TYPO3\CMS\Backend\Form\Element\SuggestDefaultReceiver::class;
}
$receiverObj = GeneralUtility::makeInstance($receiverClassName, $queryTable, $config);
$params = array('value' => $search);
......
......@@ -662,11 +662,11 @@ class FormEngine {
'inline' => array('appearance', 'behaviour', 'foreign_label', 'foreign_selector', 'foreign_unique', 'maxitems', 'minitems', 'size', 'autoSizeMax', 'symmetric_label', 'readOnly')
);
// Create instance of InlineElement only if this a non-IRRE-AJAX call:
if (!isset($GLOBALS['ajaxID']) || strpos($GLOBALS['ajaxID'], 'TYPO3\\CMS\\Backend\\Form\\Element\\InlineElement::') !== 0) {
if (!isset($GLOBALS['ajaxID']) || strpos($GLOBALS['ajaxID'], \TYPO3\CMS\Backend\Form\Element\InlineElement::class . '::') !== 0) {
$this->inline = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Form\Element\InlineElement::class);
}
// Create instance of \TYPO3\CMS\Backend\Form\Element\SuggestElement only if this a non-Suggest-AJAX call:
if (!isset($GLOBALS['ajaxID']) || strpos($GLOBALS['ajaxID'], 'TYPO3\\CMS\\Backend\\Form\\Element\\SuggestElement::') !== 0) {
if (!isset($GLOBALS['ajaxID']) || strpos($GLOBALS['ajaxID'], \TYPO3\CMS\Backend\Form\Element\SuggestElement::class . '::') !== 0) {
$this->suggest = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Form\Element\SuggestElement::class);
}
// Prepare user defined objects (if any) for hooks which extend this function:
......@@ -2408,7 +2408,7 @@ class FormEngine {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['dbFileIcons'] as $classRef) {
$hookObject = GeneralUtility::getUserObj($classRef);
if (!$hookObject instanceof DatabaseFileIconsHookInterface) {
throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Backend\\Form\\DatabaseFileIconsHookInterface', 1290167704);
throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Backend\Form\DatabaseFileIconsHookInterface::class, 1290167704);
}
$additionalParams = array(
'mode' => $mode,
......
......@@ -46,7 +46,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
*
* \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
* 'web_info',
* 'TYPO3\\CMS\\Frontend\\Controller\\PageInformationController',
* \TYPO3\CMS\Frontend\Controller\PageInformationController::class,
* NULL,
* 'LLL:EXT:cms/locallang_tca.xlf:mod_tx_cms_webinfo_page'
* );
......@@ -61,7 +61,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
*
* \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction(
* 'web_func',
* 'TYPO3\\CMS\\WizardCrpages\\Controller\\CreatePagesWizardModuleFunctionController',
* \TYPO3\CMS\WizardCrpages\Controller\CreatePagesWizardModuleFunctionController::class
* NULL,
* 'LLL:EXT:wizard_crpages/locallang.xlf:wiz_crMany',
* 'wiz'
......
......@@ -160,7 +160,7 @@ class ModuleSettings {
public function setStoreList($storeList) {
$this->storeList = is_array($storeList) ? $storeList : GeneralUtility::trimExplode(',', $storeList, TRUE);
if ($this->writeDevLog) {
GeneralUtility::devLog('Store list:' . implode(',', $this->storeList), 'TYPO3\\CMS\\Backend\\ModuleSettings', 0);
GeneralUtility::devLog('Store list:' . implode(',', $this->storeList), \TYPO3\CMS\Backend\ModuleSettings::class, 0);
}
}
......@@ -174,7 +174,7 @@ class ModuleSettings {
$storeList = is_array($storeList) ? $storeList : GeneralUtility::trimExplode(',', $storeList, TRUE);
$this->storeList = array_merge($this->storeList, $storeList);
if ($this->writeDevLog) {
GeneralUtility::devLog('Store list:' . implode(',', $this->storeList), 'TYPO3\\CMS\\Backend\\ModuleSettings', 0);
GeneralUtility::devLog('Store list:' . implode(',', $this->storeList), \TYPO3\CMS\Backend\ModuleSettings::class, 0);
}
}
......@@ -194,7 +194,7 @@ class ModuleSettings {
}
unset($this->storeList[$this->prefix . '_storedSettings']);
if ($this->writeDevLog) {
GeneralUtility::devLog('Store list:' . implode(',', $this->storeList), 'TYPO3\\CMS\\Backend\\ModuleSettings', 0);
GeneralUtility::devLog('Store list:' . implode(',', $this->storeList), \TYPO3\CMS\Backend\ModuleSettings::class, 0);
}
}
......@@ -290,7 +290,7 @@ class ModuleSettings {
$writeArray = array();
if (is_array($storeControl)) {
if ($this->writeDevLog) {
GeneralUtility::devLog('Store command: ' . GeneralUtility::arrayToLogString($storeControl), 'TYPO3\\CMS\\Backend\\ModuleSettings', 0);
GeneralUtility::devLog('Store command: ' . GeneralUtility::arrayToLogString($storeControl), \TYPO3\CMS\Backend\ModuleSettings::class, 0);
}
// Processing LOAD
if ($storeControl['LOAD'] and $storeIndex) {
......@@ -340,7 +340,7 @@ class ModuleSettings {
$writeArray[$this->prefix . '_storedSettings'] = serialize($this->storedSettings);
$GLOBALS['SOBE']->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($GLOBALS['SOBE']->MOD_MENU, $writeArray, $mconfName ? $mconfName : $GLOBALS['SOBE']->MCONF['name'], $this->type);
if ($this->writeDevLog) {
GeneralUtility::devLog('Settings stored:' . $this->msg, 'TYPO3\\CMS\\Backend\\ModuleSettings', 0);
GeneralUtility::devLog('Settings stored:' . $this->msg, \TYPO3\CMS\Backend\ModuleSettings::class, 0);
}
}
......
......@@ -83,7 +83,7 @@ class SpriteManager {
$handler = GeneralUtility::makeInstance($handlerClass);
// Throw exception if handler class does not implement required interface
if (!$handler instanceof \TYPO3\CMS\Backend\Sprite\SpriteIconGeneratorInterface) {
throw new \RuntimeException('Class ' . $handlerClass . ' in $TYPO3_CONF_VARS[BE][spriteIconGenerator_handler] ' . ' does not implement TYPO3\\CMS\\Backend\\Sprite\\SpriteIconGeneratorInterface', 1294586333);
throw new \RuntimeException('Class ' . $handlerClass . ' in $TYPO3_CONF_VARS[BE][spriteIconGenerator_handler] ' . ' does not implement ' . \TYPO3\CMS\Backend\Sprite\SpriteIconGeneratorInterface::class, 1294586333);
}
// Create temp directory if missing
if (!is_dir((PATH_site . self::$tempPath))) {
......
......@@ -911,7 +911,7 @@ function jumpToUrl(URL) {
// Logging: Can't find better place to put it:
if (TYPO3_DLOG) {
GeneralUtility::devLog('END of BACKEND session', 'TYPO3\\CMS\\Backend\\Template\\DocumentTemplate', 0, array('_FLUSH' => TRUE));
GeneralUtility::devLog('END of BACKEND session', \TYPO3\CMS\Backend\Template\DocumentTemplate::class, 0, array('_FLUSH' => TRUE));
}
return $str;
}
......
......@@ -393,7 +393,7 @@ class PagePositionMap {
$row1 = '';
$row2 = '';
$count = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(count($colPosArray), 1);
$backendLayout = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getSelectedBackendLayout', $pid, $this);
$backendLayout = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getSelectedBackendLayout', $pid, $this);
if (isset($backendLayout['__config']['backend_layout.'])) {
$table = '<div class="t3-gridContainer"><table border="0" cellspacing="0" cellpadding="0" id="typo3-ttContentList">';
$colCount = (int)$backendLayout['__config']['backend_layout.']['colCount'];
......@@ -403,7 +403,7 @@ class PagePositionMap {
$table .= '<col style="width:' . 100 / $colCount . '%"></col>';
}
$table .= '</colgroup>';
$tcaItems = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getColPosListItemsParsed', $pid, $this);
$tcaItems = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $pid, $this);
// Cycle through rows
for ($row = 1; $row <= $rowCount; $row++) {
$rowConfig = $backendLayout['__config']['backend_layout.']['rows.'][$row . '.'];
......
......@@ -529,7 +529,7 @@ class BackendUtility {
}
// Sort fields by the translated value
if (count($excludeArrayTable) > 0) {
usort($excludeArrayTable, array('TYPO3\\CMS\\Backend\\Form\\FlexFormsHelper', 'compareArraysByFirstValue'));
usort($excludeArrayTable, array(\TYPO3\CMS\Backend\Form\FlexFormsHelper::class, 'compareArraysByFirstValue'));
$finalExcludeArray = array_merge($finalExcludeArray, $excludeArrayTable);
}
}
......@@ -2941,7 +2941,7 @@ class BackendUtility {
*/
static public function setUpdateSignal($set = '', $params = '') {
$beUser = static::getBackendUserAuthentication();
$modData = $beUser->getModuleData('TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getUpdateSignal', 'ses');
$modData = $beUser->getModuleData(\TYPO3\CMS\Backend\Utility\BackendUtility::class . '::getUpdateSignal', 'ses');
if ($set) {
$modData[$set] = array(
'set' => $set,
......@@ -2951,7 +2951,7 @@ class BackendUtility {
// clear the module data
$modData = array();
}
$beUser->pushModuleData('TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getUpdateSignal', $modData);
$beUser->pushModuleData(\TYPO3\CMS\Backend\Utility\BackendUtility::class . '::getUpdateSignal', $modData);
}
/**
......@@ -2964,7 +2964,7 @@ class BackendUtility {
*/
static public function getUpdateSignalCode() {
$signals = array();
$modData = static::getBackendUserAuthentication()->getModuleData('TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getUpdateSignal', 'ses');
$modData = static::getBackendUserAuthentication()->getModuleData(\TYPO3\CMS\Backend\Utility\BackendUtility::class . '::getUpdateSignal', 'ses');
if (!count($modData)) {
return '';
}
......
......@@ -786,7 +786,7 @@ class IconUtility {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_iconworks.php']['overrideResourceIcon'] as $classRef) {
$hookObject = GeneralUtility::getUserObj($classRef);
if (!$hookObject instanceof IconUtilityOverrideResourceIconHookInterface) {
throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Backend\\Utility\\IconUtilityOverrideResourceIconHookInterface', 1393574895);
throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Backend\Utility\IconUtilityOverrideResourceIconHookInterface::class, 1393574895);
}
$hookObject->overrideResourceIcon($resource, $iconName, $options, $overlays);
}
......@@ -1051,7 +1051,7 @@ class IconUtility {
* @return array
*/
static protected function emitBuildSpriteHtmlIconTagSignal(array $tagAttributes, $innerHtml, $tagName) {
return static::getSignalSlotDispatcher()->dispatch('TYPO3\\CMS\\Backend\\Utility\\IconUtility', 'buildSpriteHtmlIconTag', array($tagAttributes, $innerHtml, $tagName));
return static::getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Backend\Utility\IconUtility::class, 'buildSpriteHtmlIconTag', array($tagAttributes, $innerHtml, $tagName));
}
/**
......@@ -1062,7 +1062,7 @@ class IconUtility {
* @param string $cssClasses the CSS classes to be used as a string
*/
static protected function emitBuildSpriteIconClassesSignal($iconName, &$cssClasses) {
static::getSignalSlotDispatcher()->dispatch('TYPO3\\CMS\\Backend\\Utility\\IconUtility', 'buildSpriteIconClasses', array($iconName, &$cssClasses));
static::getSignalSlotDispatcher()->dispatch(\TYPO3\CMS\Backend\Utility\IconUtility::class, 'buildSpriteIconClasses', array($iconName, &$cssClasses));
}
/**
......
......@@ -57,7 +57,7 @@ class DataProviderCollection implements \TYPO3\CMS\Core\SingletonInterface {
if (!$dataProvider instanceof DataProviderInterface) {
throw new \LogicException(
$className . ' must implement interface TYPO3\\CMS\\Backend\\View\\BackendLayout\\DataProviderInterface',
$className . ' must implement interface ' . \TYPO3\CMS\Backend\View\BackendLayout\DataProviderInterface::class,
1381269811
);
}
......
......@@ -60,7 +60,7 @@ class BackendLayoutView implements \TYPO3\CMS\Core\SingletonInterface {
$dataProviderCollection->add(
'default',
'TYPO3\\CMS\\Backend\\View\\BackendLayout\\DefaultDataProvider'
\TYPO3\CMS\Backend\View\BackendLayout\DefaultDataProvider::class
);
if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['BackendLayoutDataProvider'])) {
......
......@@ -549,7 +549,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
// Add new-icon link, header:
$newP = $this->newContentElementOnClick($id, $key, $lP);
$colTitle = BackendUtility::getProcessedValue('tt_content', 'colPos', $key);
$tcaItems = GeneralUtility::callUserFunction('TYPO3\\CMS\\Backend\\View\\BackendLayoutView->getColPosListItemsParsed', $id, $this);
$tcaItems = GeneralUtility::callUserFunction(\TYPO3\CMS\Backend\View\BackendLayoutView::class . '->getColPosListItemsParsed', $id, $this);
foreach ($tcaItems as $item) {
if ($item[1] == $key) {
$colTitle = $this->getLanguageService()->sL($item[0]);
......@@ -1451,7 +1451,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
foreach ($drawItemHooks as $hookClass) {
$hookObject = GeneralUtility::getUserObj($hookClass);
if (!$hookObject instanceof PageLayoutViewDrawItemHookInterface) {
throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Backend\\View\\PageLayoutViewDrawItemHookInterface', 1218547409);
throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface::class, 1218547409);
}
$hookObject->preProcess($this, $drawItem, $outHeader, $out, $row);
}
......
......@@ -52,7 +52,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
$GLOBALS['TCA'][$this->testTableName] = array('ctrl' => array());
$GLOBALS[$this->testGlobalNamespace] = array();
$this->setUpBackend();
$this->matchCondition = $this->getMock('TYPO3\\CMS\\Backend\\Configuration\\TypoScript\\ConditionMatching\\ConditionMatcher', array('determineRootline'), array(), '', FALSE);
$this->matchCondition = $this->getMock(\TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher::class, array('determineRootline'), array(), '', FALSE);
}
/**
......@@ -71,7 +71,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* Set up database mock
*/
private function setUpDatabaseMockForDeterminePageId() {
$GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array('exec_SELECTquery', 'sql_fetch_assoc', 'sql_free_result'));
$GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array('exec_SELECTquery', 'sql_fetch_assoc', 'sql_free_result'));
$GLOBALS['TYPO3_DB']->expects($this->any())->method('exec_SELECTquery')->will($this->returnCallback(array($this, 'determinePageIdByRecordDatabaseExecuteCallback')));
$GLOBALS['TYPO3_DB']->expects($this->any())->method('sql_fetch_assoc')->will($this->returnCallback(array($this, 'determinePageIdByRecordDatabaseFetchCallback')));
}
......@@ -582,7 +582,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function treeLevelConditionMatchesCurrentPageIdWhileEditingNewPage() {
$GLOBALS['SOBE'] = $this->getMock('TYPO3\\CMS\\Backend\\Controller\\EditDocumentController', array(), array(), '', FALSE);
$GLOBALS['SOBE'] = $this->getMock(\TYPO3\CMS\Backend\Controller\EditDocumentController::class, array(), array(), '', FALSE);
$GLOBALS['SOBE']->elementsData = array(
array(
'table' => 'pages',
......@@ -604,7 +604,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function treeLevelConditionMatchesCurrentPageIdWhileSavingNewPage() {
$GLOBALS['SOBE'] = $this->getMock('TYPO3\\CMS\\Backend\\Controller\\EditDocumentController', array(), array(), '', FALSE);
$GLOBALS['SOBE'] = $this->getMock(\TYPO3\CMS\Backend\Controller\EditDocumentController::class, array(), array(), '', FALSE);
$GLOBALS['SOBE']->elementsData = array(
array(
'table' => 'pages',
......@@ -677,7 +677,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function PIDupinRootlineConditionMatchesCurrentPageIdWhileEditingNewPage() {
$GLOBALS['SOBE'] = $this->getMock('TYPO3\\CMS\\Backend\\Controller\\EditDocumentController', array(), array(), '', FALSE);
$GLOBALS['SOBE'] = $this->getMock(\TYPO3\CMS\Backend\Controller\EditDocumentController::class, array(), array(), '', FALSE);
$GLOBALS['SOBE']->elementsData = array(
array(
'table' => 'pages',
......@@ -699,7 +699,7 @@ class ConditionMatcherTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function PIDupinRootlineConditionMatchesCurrentPageIdWhileSavingNewPage() {
$GLOBALS['SOBE'] = $this->getMock('TYPO3\\CMS\\Backend\\Controller\\EditDocumentController', array(), array(), '', FALSE);
$GLOBALS['SOBE'] = $this->getMock(\TYPO3\CMS\Backend\Controller\EditDocumentController::class, array(), array(), '', FALSE);
$GLOBALS['SOBE']->elementsData = array(
array(
'table' => 'pages',
......
......@@ -48,9 +48,9 @@ class FileControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* Sets up this test case.
*/
protected function setUp() {
$this->fileResourceMock = $this->getMock('TYPO3\\CMS\\Core\\Resource\\File', array('toArray', 'getModificationTime', 'getExtension'), array(), '', FALSE);
$this->folderResourceMock = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Folder', array('getIdentifier'), array(), '', FALSE);
$this->mockFileProcessor = $this->getMock('TYPO3\\CMS\\Core\\Utility\\File\ExtendedFileUtility', array('getErrorMessages'), array(), '', FALSE);
$this->fileResourceMock = $this->getMock(\TYPO3\CMS\Core\Resource\File::class, array('toArray', 'getModificationTime', 'getExtension'), array(), '', FALSE);
$this->folderResourceMock = $this->getMock(\TYPO3\CMS\Core\Resource\Folder::class, array('getIdentifier'), array(), '', FALSE);
$this->mockFileProcessor = $this->getMock(\TYPO3\CMS\Core\Utility\File\ExtendedFileUtility::class, array('getErrorMessages'), array(), '', FALSE);
$this->fileResourceMock->expects($this->any())->method('toArray')->will($this->returnValue(array('id' => 'foo')));
$this->fileResourceMock->expects($this->any())->method('getModificationTime')->will($this->returnValue(123456789));
......@@ -61,7 +61,7 @@ class FileControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function flattenResultDataValueFlattensFileAndFolderResourcesButReturnsAnythingElseAsIs() {
$this->fileController = $this->getAccessibleMock('TYPO3\\CMS\\Backend\\Controller\\File\\FileController', array('dummy'));
$this->fileController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, array('dummy'));
$this->folderResourceMock->expects($this->once())->method('getIdentifier')->will($this->returnValue('bar'));
......@@ -89,8 +89,8 @@ class FileControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function processAjaxRequestDeleteProcessActuallyDoesNotChangeFileData() {
$this->fileController = $this->getAccessibleMock('TYPO3\\CMS\\Backend\\Controller\\File\\FileController', array('init', 'main'));
$this->mockAjaxRequestHandler = $this->getMock('TYPO3\\CMS\\Core\\Http\\AjaxRequestHandler', array('addContent', 'setContentFormat'), array(), '', FALSE);
$this->fileController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, array('init', 'main'));
$this->mockAjaxRequestHandler = $this->getMock(\TYPO3\CMS\Core\Http\AjaxRequestHandler::class, array('addContent', 'setContentFormat'), array(), '', FALSE);
$fileData = array('delete' => array(TRUE));
$this->fileController->_set('fileProcessor', $this->mockFileProcessor);
......@@ -109,8 +109,8 @@ class FileControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function processAjaxRequestEditFileProcessActuallyDoesNotChangeFileData() {
$this->fileController = $this->getAccessibleMock('TYPO3\CMS\\Backend\\Controller\\File\\FileController', array('init', 'main'));
$this->mockAjaxRequestHandler = $this->getMock('TYPO3\\CMS\\Core\\Http\\AjaxRequestHandler', array('addContent', 'setContentFormat'), array(), '', FALSE);
$this->fileController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, array('init', 'main'));
$this->mockAjaxRequestHandler = $this->getMock(\TYPO3\CMS\Core\Http\AjaxRequestHandler::class, array('addContent', 'setContentFormat'), array(), '', FALSE);
$fileData = array('editfile' => array(TRUE));
$this->fileController->_set('fileProcessor', $this->mockFileProcessor);
......@@ -129,8 +129,8 @@ class FileControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function processAjaxRequestUnzipProcessActuallyDoesNotChangeFileData() {
$this->fileController = $this->getAccessibleMock('TYPO3\\CMS\\Backend\\Controller\\File\\FileController', array('init', 'main'));
$this->mockAjaxRequestHandler = $this->getMock('TYPO3\\CMS\\Core\\Http\\AjaxRequestHandler', array('addContent', 'setContentFormat'), array(), '', FALSE);
$this->fileController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, array('init', 'main'));
$this->mockAjaxRequestHandler = $this->getMock(\TYPO3\CMS\Core\Http\AjaxRequestHandler::class, array('addContent', 'setContentFormat'), array(), '', FALSE);
$fileData = array('unzip' => array(TRUE));
$this->fileController->_set('fileProcessor', $this->mockFileProcessor);
......@@ -149,8 +149,8 @@ class FileControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
* @test
*/
public function processAjaxRequestUploadProcess() {
$this->fileController = $this->getAccessibleMock('TYPO3\\CMS\Backend\\Controller\\File\\FileController', array('init', 'main'));
$this->mockAjaxRequestHandler = $this->getMock('TYPO3\\CMS\\Core\\Http\\AjaxRequestHandler', array('addContent', 'setContentFormat'), array(), '', FALSE);
$this->fileController = $this->getAccessibleMock(\TYPO3\CMS\Backend\Controller\File\FileController::class, array('init', 'main'));
$this->mockAjaxRequestHandler = $this->getMock(\TYPO3\CMS\Core\Http\AjaxRequestHandler::class, array('addContent', 'setContentFormat'), array(), '', FALSE);
$fileData = array('upload' => array(array($this->fileResourceMock)));
$result = array('upload' => array(array(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment