[TASK] Use name-resolution instead of strings where possible: 7 62/34862/4
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Mon, 1 Dec 2014 12:54:20 +0000 (13:54 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Fri, 5 Dec 2014 15:43:12 +0000 (16:43 +0100)
(part for EXT:frontend)

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: I60e9d2f7a1883f97c9a84d35dbd6e5e403e62b4b
Resolves: #63477
Releases: master
Reviewed-on: http://review.typo3.org/34862
Reviewed-by: Alexander Opitz <opitz.alexander@googlemail.com>
Tested-by: Alexander Opitz <opitz.alexander@googlemail.com>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
19 files changed:
typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
typo3/sysext/frontend/Classes/ContentObject/Menu/MenuContentObjectFactory.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/MediaWizard/MediaWizardProviderManager.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Configuration/TCA/tt_content.php
typo3/sysext/frontend/Tests/Functional/ContentObject/FluidTemplateContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FilesContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/ContentObject/Menu/AbstractMenuContentObjectTest.php
typo3/sysext/frontend/Tests/Unit/Controller/DataSubmissionControllerTest.php
typo3/sysext/frontend/Tests/Unit/Controller/TypoScriptFrontendControllerTest.php
typo3/sysext/frontend/Tests/Unit/Page/CacheHashCalculatorTest.php
typo3/sysext/frontend/Tests/Unit/Page/PageRepositoryTest.php
typo3/sysext/frontend/Tests/Unit/View/AdminPanelViewTest.php
typo3/sysext/frontend/ext_localconf.php

index e8ca62e..f8f554f 100644 (file)
@@ -275,9 +275,9 @@ class FrontendUserAuthentication extends \TYPO3\CMS\Core\Authentication\Abstract
                $authInfo = $this->getAuthInfoArray();
                if ($this->writeDevLog) {
                        if (is_array($this->user)) {
-                               GeneralUtility::devLog('Get usergroups for user: ' . GeneralUtility::arrayToLogString($this->user, array($this->userid_column, $this->username_column)), 'TYPO3\\CMS\\Frontend\\Authentication\\FrontendUserAuthentication');
+                               GeneralUtility::devLog('Get usergroups for user: ' . GeneralUtility::arrayToLogString($this->user, array($this->userid_column, $this->username_column)), \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::class);
                        } else {
-                               GeneralUtility::devLog('Get usergroups for "anonymous" user', 'TYPO3\\CMS\\Frontend\\Authentication\\FrontendUserAuthentication');
+                               GeneralUtility::devLog('Get usergroups for "anonymous" user', \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::class);
                        }
                }
                $groupDataArr = array();
@@ -295,13 +295,13 @@ class FrontendUserAuthentication extends \TYPO3\CMS\Core\Authentication\Abstract
                        unset($serviceObj);
                }
                if ($this->writeDevLog && $serviceChain) {
-                       GeneralUtility::devLog($subType . ' auth services called: ' . $serviceChain, 'TYPO3\\CMS\\Frontend\\Authentication\\FrontendUserAuthentication');
+                       GeneralUtility::devLog($subType . ' auth services called: ' . $serviceChain, \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::class);
                }
                if ($this->writeDevLog && !count($groupDataArr)) {
-                       GeneralUtility::devLog('No usergroups found by services', 'TYPO3\\CMS\\Frontend\\Authentication\\FrontendUserAuthentication');
+                       GeneralUtility::devLog('No usergroups found by services', \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::class);
                }
                if ($this->writeDevLog && count($groupDataArr)) {
-                       GeneralUtility::devLog(count($groupDataArr) . ' usergroup records found by services', 'TYPO3\\CMS\\Frontend\\Authentication\\FrontendUserAuthentication');
+                       GeneralUtility::devLog(count($groupDataArr) . ' usergroup records found by services', \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::class);
                }
                // Use 'auth' service to check the usergroups if they are really valid
                foreach ($groupDataArr as $groupData) {
@@ -315,7 +315,7 @@ class FrontendUserAuthentication extends \TYPO3\CMS\Core\Authentication\Abstract
                                if (!$serviceObj->authGroup($this->user, $groupData)) {
                                        $validGroup = FALSE;
                                        if ($this->writeDevLog) {
-                                               GeneralUtility::devLog($subType . ' auth service did not auth group: ' . GeneralUtility::arrayToLogString($groupData, 'uid,title'), 'TYPO3\\CMS\\Frontend\\Authentication\\FrontendUserAuthentication', 2);
+                                               GeneralUtility::devLog($subType . ' auth service did not auth group: ' . GeneralUtility::arrayToLogString($groupData, 'uid,title'), \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::class, 2);
                                        }
                                        break;
                                }
index b42d66e..ce5c219 100644 (file)
@@ -612,7 +612,7 @@ class ContentObjectRenderer {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['stdWrap'] as $classData) {
                                $hookObject = GeneralUtility::getUserObj($classData);
                                if (!$hookObject instanceof \TYPO3\CMS\Frontend\ContentObject\ContentObjectStdWrapHookInterface) {
-                                       throw new \UnexpectedValueException($classData . ' must implement interface TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectStdWrapHookInterface', 1195043965);
+                                       throw new \UnexpectedValueException($classData . ' must implement interface ' . \TYPO3\CMS\Frontend\ContentObject\ContentObjectStdWrapHookInterface::class, 1195043965);
                                }
                                $this->stdWrapHookObjects[] = $hookObject;
                        }
@@ -621,7 +621,7 @@ class ContentObjectRenderer {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['postInit'] as $classData) {
                                $postInitializationProcessor = GeneralUtility::getUserObj($classData);
                                if (!$postInitializationProcessor instanceof \TYPO3\CMS\Frontend\ContentObject\ContentObjectPostInitHookInterface) {
-                                       throw new \UnexpectedValueException($classData . ' must implement interface TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectPostInitHookInterface', 1274563549);
+                                       throw new \UnexpectedValueException($classData . ' must implement interface ' . \TYPO3\CMS\Frontend\ContentObject\ContentObjectPostInitHookInterface::class, 1274563549);
                                }
                                $postInitializationProcessor->postProcessContentObjectInitialization($this);
                        }
@@ -650,7 +650,7 @@ class ContentObjectRenderer {
                                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImgResource'] as $classData) {
                                        $hookObject = GeneralUtility::getUserObj($classData);
                                        if (!$hookObject instanceof \TYPO3\CMS\Frontend\ContentObject\ContentObjectGetImageResourceHookInterface) {
-                                               throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectGetImageResourceHookInterface', 1218636383);
+                                               throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Frontend\ContentObject\ContentObjectGetImageResourceHookInterface::class, 1218636383);
                                        }
                                        $this->getImgResourceHookObjects[] = $hookObject;
                                }
@@ -780,7 +780,7 @@ class ContentObjectRenderer {
                                                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['cObjTypeAndClassDefault'] as $classData) {
                                                                $hookObject = GeneralUtility::getUserObj($classData);
                                                                if (!$hookObject instanceof \TYPO3\CMS\Frontend\ContentObject\ContentObjectGetSingleHookInterface) {
-                                                                       throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectGetSingleHookInterface', 1195043731);
+                                                                       throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Frontend\ContentObject\ContentObjectGetSingleHookInterface::class, 1195043731);
                                                                }
                                                                /** @var $hookObject \TYPO3\CMS\Frontend\ContentObject\ContentObjectGetSingleHookInterface */
                                                                $content .= $hookObject->getSingleContentObject($name, (array)$conf, $TSkey, $this);
@@ -893,7 +893,7 @@ class ContentObjectRenderer {
                }
 
                if ($exceptionHandlerClassName === '1') {
-                       $exceptionHandlerClassName = 'TYPO3\\CMS\\Frontend\\ContentObject\\Exception\\ProductionExceptionHandler';
+                       $exceptionHandlerClassName = \TYPO3\CMS\Frontend\ContentObject\Exception\ProductionExceptionHandler::class;
                }
 
                return $exceptionHandlerClassName;
@@ -1006,7 +1006,7 @@ class ContentObjectRenderer {
         */
        public function convertToUserIntObject() {
                if ($this->userObjectType !== self::OBJECTTYPE_USER) {
-                       $GLOBALS['TT']->setTSlogMessage('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer::convertToUserIntObject() ' . 'is called in the wrong context or for the wrong object type', 2);
+                       $GLOBALS['TT']->setTSlogMessage(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class . '::convertToUserIntObject() is called in the wrong context or for the wrong object type', 2);
                } else {
                        $this->doConvertToUserIntObject = TRUE;
                }
@@ -1518,7 +1518,7 @@ class ContentObjectRenderer {
                                                        $hookObject = GeneralUtility::getUserObj($classData);
                                                        if (!$hookObject instanceof ContentObjectOneSourceCollectionHookInterface) {
                                                                throw new \UnexpectedValueException(
-                                                                       '$hookObject must implement interface TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectOneSourceCollectionHookInterface',
+                                                                       '$hookObject must implement interface ' . \TYPO3\CMS\Frontend\ContentObject\ContentObjectOneSourceCollectionHookInterface::class,
                                                                        1380007853
                                                                );
                                                        }
@@ -5566,7 +5566,7 @@ class ContentObjectRenderer {
                                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getData'] as $classData) {
                                        $hookObject = GeneralUtility::getUserObj($classData);
                                        if (!$hookObject instanceof \TYPO3\CMS\Frontend\ContentObject\ContentObjectGetDataHookInterface) {
-                                               throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectGetDataHookInterface', 1195044480);
+                                               throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Frontend\ContentObject\ContentObjectGetDataHookInterface::class, 1195044480);
                                        }
                                        $retVal = $hookObject->getDataExtension($string, $fieldArray, $secVal, $retVal, $this);
                                }
index 064cd7a..cad2d3e 100644 (file)
@@ -967,7 +967,7 @@ class AbstractMenuContentObject {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'] as $classRef) {
                                $hookObject = GeneralUtility::getUserObj($classRef);
                                if (!$hookObject instanceof \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuFilterPagesHookInterface) {
-                                       throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\ContentObject\\Menu\\AbstractMenuFilterPagesHookInterface', 1269877402);
+                                       throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuFilterPagesHookInterface::class, 1269877402);
                                }
                                $includePage = $includePage && $hookObject->processFilter($data, $banUidArray, $spacer, $this);
                        }
index 447f291..f4aa516 100644 (file)
@@ -29,10 +29,10 @@ class MenuContentObjectFactory implements \TYPO3\CMS\Core\SingletonInterface {
         * @var array
         */
        protected $menuTypeToClassMapping = array(
-               'GMENU' => 'TYPO3\\CMS\\Frontend\\ContentObject\\Menu\\GraphicalMenuContentObject',
-               'TMENU' => 'TYPO3\\CMS\\Frontend\\ContentObject\\Menu\\TextMenuContentObject',
-               'IMGMENU' => 'TYPO3\\CMS\\Frontend\\ContentObject\\Menu\\ImageMenuContentObject',
-               'JSMENU' => 'TYPO3\\CMS\\Frontend\\ContentObject\\Menu\\JavaScriptMenuContentObject',
+               'GMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\GraphicalMenuContentObject::class,
+               'TMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\TextMenuContentObject::class,
+               'IMGMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\ImageMenuContentObject::class,
+               'JSMENU' => \TYPO3\CMS\Frontend\ContentObject\Menu\JavaScriptMenuContentObject::class,
        );
 
        /**
index de06c49..36d6018 100644 (file)
@@ -1048,7 +1048,7 @@ class TypoScriptFrontendController {
                        $this->gr_list .= ',' . implode(',', $gr_array);
                }
                if ($this->fe_user->writeDevLog) {
-                       GeneralUtility::devLog('Valid usergroups for TSFE: ' . $this->gr_list, 'TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController');
+                       GeneralUtility::devLog('Valid usergroups for TSFE: ' . $this->gr_list, \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class);
                }
        }
 
index 8a40b77..dfae41d 100644 (file)
@@ -54,7 +54,7 @@ class MediaWizardProviderManager {
                        if (!isset(self::$providerObjects[$className])) {
                                $provider = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($className);
                                if (!$provider instanceof MediaWizardProviderInterface) {
-                                       throw new \UnexpectedValueException($className . ' is registered as a mediaWizardProvider, so it must implement interface TYPO3\\CMS\\Frontend\\MediaWizard\\MediaWizardProviderInterface', 1285022360);
+                                       throw new \UnexpectedValueException($className . ' is registered as a mediaWizardProvider, so it must implement interface ' . \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderInterface::class, 1285022360);
                                }
                                self::$providerObjects[$className] = $provider;
                        }
index 5bfdbd7..2684050 100644 (file)
@@ -200,7 +200,7 @@ class PageRepository {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'] as $classRef) {
                                $hookObject = GeneralUtility::getUserObj($classRef);
                                if (!$hookObject instanceof \TYPO3\CMS\Frontend\Page\PageRepositoryGetPageHookInterface) {
-                                       throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetPageHookInterface', 1251476766);
+                                       throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Frontend\Page\PageRepositoryGetPageHookInterface::class, 1251476766);
                                }
                                $hookObject->getPage_preProcess($uid, $disableGroupAccessCheck, $this);
                        }
@@ -313,7 +313,7 @@ class PageRepository {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPageOverlay'] as $classRef) {
                                $hookObject = GeneralUtility::getUserObj($classRef);
                                if (!$hookObject instanceof \TYPO3\CMS\Frontend\Page\PageRepositoryGetPageOverlayHookInterface) {
-                                       throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetPageOverlayHookInterface', 1269878881);
+                                       throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Frontend\Page\PageRepositoryGetPageOverlayHookInterface::class, 1269878881);
                                }
                                $hookObject->getPageOverlay_preProcess($pageInput, $lUid, $this);
                        }
@@ -388,7 +388,7 @@ class PageRepository {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] as $classRef) {
                                $hookObject = GeneralUtility::getUserObj($classRef);
                                if (!$hookObject instanceof \TYPO3\CMS\Frontend\Page\PageRepositoryGetRecordOverlayHookInterface) {
-                                       throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetRecordOverlayHookInterface', 1269881658);
+                                       throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Frontend\Page\PageRepositoryGetRecordOverlayHookInterface::class, 1269881658);
                                }
                                $hookObject->getRecordOverlay_preProcess($table, $row, $sys_language_content, $OLmode, $this);
                        }
@@ -449,7 +449,7 @@ class PageRepository {
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getRecordOverlay'] as $classRef) {
                                $hookObject = GeneralUtility::getUserObj($classRef);
                                if (!$hookObject instanceof \TYPO3\CMS\Frontend\Page\PageRepositoryGetRecordOverlayHookInterface) {
-                                       throw new \UnexpectedValueException('$hookObject must implement interface TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetRecordOverlayHookInterface', 1269881659);
+                                       throw new \UnexpectedValueException('$hookObject must implement interface ' . \TYPO3\CMS\Frontend\Page\PageRepositoryGetRecordOverlayHookInterface::class, 1269881659);
                                }
                                $hookObject->getRecordOverlay_postProcess($table, $row, $sys_language_content, $OLmode, $this);
                        }
@@ -571,8 +571,8 @@ class PageRepository {
                                        $redirectUrl .= '/' . $prependStr;
                                }
                                $statusCode = (int)$row['redirectHttpStatusCode'];
-                               if ($statusCode && defined('TYPO3\\CMS\\Core\\Utility\\HttpUtility::HTTP_STATUS_' . $statusCode)) {
-                                       \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl, constant('TYPO3\\CMS\\Core\\Utility\\HttpUtility::HTTP_STATUS_' . $statusCode));
+                               if ($statusCode && defined(\TYPO3\CMS\Core\Utility\HttpUtility::class . '::HTTP_STATUS_' . $statusCode)) {
+                                       \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl, constant(\TYPO3\CMS\Core\Utility\HttpUtility::class . '::HTTP_STATUS_' . $statusCode));
                                } else {
                                        \TYPO3\CMS\Core\Utility\HttpUtility::redirect($redirectUrl, \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_301);
                                }
index da0af85..2f59c95 100644 (file)
@@ -319,7 +319,7 @@ return array(
                        'label' => 'LLL:EXT:cms/locallang_ttc.xlf:colPos',
                        'config' => array(
                                'type' => 'select',
-                               'itemsProcFunc' => 'TYPO3\\CMS\\Backend\\View\\BackendLayoutView->colPosListItemProcFunc',
+                               'itemsProcFunc' => \TYPO3\CMS\Backend\View\BackendLayoutView::class . '->colPosListItemProcFunc',
                                'items' => array(
                                        array(
                                                'LLL:EXT:cms/locallang_ttc.xlf:colPos.I.0',
@@ -1189,7 +1189,7 @@ return array(
                                                ''
                                        )
                                ),
-                               'itemsProcFunc' => 'TYPO3\\CMS\\Frontend\\Hooks\\TableColumnHooks->sortPluginList',
+                               'itemsProcFunc' => \TYPO3\CMS\Frontend\Hooks\TableColumnHooks::class . '->sortPluginList',
                                'default' => '',
                                'authMode' => $GLOBALS['TYPO3_CONF_VARS']['BE']['explicitADmode'],
                                'iconsInOptionTags' => 1,
@@ -1613,7 +1613,7 @@ return array(
                                'minitems' => 0,
                                'maxitems' => 1,
                                'suppress_icons' => 1,
-                               'itemsProcFunc' => 'TYPO3\\CMS\\Core\\Category\\CategoryRegistry->getCategoryFieldsForTable',
+                               'itemsProcFunc' => \TYPO3\CMS\Core\Category\CategoryRegistry::class . '->getCategoryFieldsForTable',
                        )
                )
        ),
index f337674..21d74b2 100644 (file)
@@ -26,7 +26,7 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\FunctionalTes
         */
        public function renderWorksWithNestedFluidtemplate() {
                /** @var $tsfe \TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController */
-               $tsfe = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array(), '', FALSE);
+               $tsfe = $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array(), array(), '', FALSE);
                $GLOBALS['TSFE'] = $tsfe;
 
                $configuration = array(
index a3e659d..2de436a 100644 (file)
@@ -55,10 +55,10 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->singletonInstances = \TYPO3\CMS\Core\Utility\GeneralUtility::getSingletonInstances();
                $this->createMockedLoggerAndLogManager();
 
-               $this->templateServiceMock = $this->getMock('TYPO3\\CMS\\Core\\TypoScript\\TemplateService', array('getFileName', 'linkData'));
-               $pageRepositoryMock = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository', array('getRawRecord'));
+               $this->templateServiceMock = $this->getMock(\TYPO3\CMS\Core\TypoScript\TemplateService::class, array('getFileName', 'linkData'));
+               $pageRepositoryMock = $this->getMock(\TYPO3\CMS\Frontend\Page\PageRepository::class, array('getRawRecord'));
 
-               $this->typoScriptFrontendControllerMock = $this->getAccessibleMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array('dummy'), array(), '', FALSE);
+               $this->typoScriptFrontendControllerMock = $this->getAccessibleMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array('dummy'), array(), '', FALSE);
                $this->typoScriptFrontendControllerMock->tmpl = $this->templateServiceMock;
                $this->typoScriptFrontendControllerMock->config = array();
                $this->typoScriptFrontendControllerMock->page = array();
@@ -67,11 +67,11 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $this->typoScriptFrontendControllerMock->renderCharset = 'utf-8';
                $GLOBALS['TSFE'] = $this->typoScriptFrontendControllerMock;
 
-               $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array());
-               $GLOBALS['TYPO3_CONF_VARS']['SYS']['TYPO3\\CMS\\Core\\Charset\\CharsetConverter_utils'] = 'mbstring';
+               $GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array());
+               $GLOBALS['TYPO3_CONF_VARS']['SYS'][\TYPO3\CMS\Core\Charset\CharsetConverter_utils::class] = 'mbstring';
 
                $this->subject = $this->getAccessibleMock(
-                       'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer',
+                       \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class,
                        array('getResourceFactory', 'getEnvironmentVariable'),
                        array($this->typoScriptFrontendControllerMock)
                );
@@ -125,11 +125,11 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ->with('typo3/clear.gif')
                        ->will($this->returnValue('typo3/clear.gif'));
 
-               $resourceFactory = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceFactory', array(), array(), '', FALSE);
+               $resourceFactory = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceFactory::class, array(), array(), '', FALSE);
                $this->subject->expects($this->any())->method('getResourceFactory')->will($this->returnValue($resourceFactory));
 
                $className = uniqid('tx_coretest');
-               $getImgResourceHookMock = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectGetImageResourceHookInterface', array('getImgResourcePostProcess'), array(), $className);
+               $getImgResourceHookMock = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectGetImageResourceHookInterface::class, array('getImgResourcePostProcess'), array(), $className);
                $getImgResourceHookMock
                        ->expects($this->once())
                        ->method('getImgResourcePostProcess')
@@ -1812,7 +1812,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getDataWithTypeFileReturnsUidOfFileObject() {
                $uid = uniqid();
-               $file = $this->getMock('TYPO3\\CMS\\Core\\Resource\File', array(), array(), '', FALSE);
+               $file = $this->getMock(\TYPO3\CMS\Core\Resource\File::class, array(), array(), '', FALSE);
                $file->expects($this->once())->method('getUid')->will($this->returnValue($uid));
                $this->subject->setCurrentFile($file);
                $this->assertEquals($uid, $this->subject->getData('file:current:uid'));
@@ -2362,7 +2362,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function getImageSourceCollectionRendersDefinedSources() {
                /** @var $cObj \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer */
                $cObj = $this->getMock(
-                       'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer',
+                       \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class,
                        array('stdWrap','getImgResource')
                );
                $cObj->start(array(), 'tt_content');
@@ -2458,7 +2458,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function getImageSourceCollectionRendersDefinedLayoutKeyDefault($layoutKey , $configuration) {
                /** @var $cObj \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer */
                $cObj = $this->getMock(
-                       'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer',
+                       \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class,
                        array('stdWrap','getImgResource')
                );
                $cObj->start(array(), 'tt_content');
@@ -2579,7 +2579,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function getImageSourceCollectionRendersDefinedLayoutKeyData($layoutKey , $configuration, $xhtmlDoctype, $expectedHtml) {
                /** @var $cObj \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer */
                $cObj = $this->getMock(
-                       'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer',
+                       \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class,
                        array('stdWrap','getImgResource')
                );
                $cObj->start(array(), 'tt_content');
@@ -2613,7 +2613,7 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function getImageSourceCollectionHookCalled() {
                $this->subject = $this->getAccessibleMock(
-                       'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer',
+                       \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class,
                        array('getResourceFactory', 'stdWrap', 'getImgResource')
                );
                $this->subject->start(array(), 'tt_content');
@@ -2627,11 +2627,11 @@ class ContentObjectRendererTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        ->method('getImgResource')
                        ->will($this->returnValue(array(100, 100, NULL, 'bar-file.jpg')));
 
-               $resourceFactory = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceFactory', array(), array(), '', FALSE);
+               $resourceFactory = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceFactory::class, array(), array(), '', FALSE);
                $this->subject->expects($this->any())->method('getResourceFactory')->will($this->returnValue($resourceFactory));
 
                $className = uniqid('tx_coretest_getImageSourceCollectionHookCalled');
-               $getImageSourceCollectionHookMock = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectOneSourceCollectionHookInterface', array('getOneSourceCollection'), array(), $className);
+               $getImageSourceCollectionHookMock = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectOneSourceCollectionHookInterface::class, array('getOneSourceCollection'), array(), $className);
                $GLOBALS['T3_VAR']['getUserObj'][$className] = $getImageSourceCollectionHookMock;
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['getImageSourceCollection'][] = $className;
 
index 36682e3..0d4f1d0 100644 (file)
@@ -34,19 +34,19 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Set up
         */
        public function setUp() {
-               $templateService = $this->getMock('TYPO3\\CMS\\Core\\TypoScript\\TemplateService', array('getFileName', 'linkData'));
-               $this->tsfe = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array('dummy'), array(), '', FALSE);
+               $templateService = $this->getMock(\TYPO3\CMS\Core\TypoScript\TemplateService::class, array('getFileName', 'linkData'));
+               $this->tsfe = $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array('dummy'), array(), '', FALSE);
                $this->tsfe->tmpl = $templateService;
                $this->tsfe->config = array();
                $this->tsfe->page = array();
-               $sysPageMock = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository', array('getRawRecord'));
+               $sysPageMock = $this->getMock(\TYPO3\CMS\Frontend\Page\PageRepository::class, array('getRawRecord'));
                $this->tsfe->sys_page = $sysPageMock;
                $GLOBALS['TSFE'] = $this->tsfe;
                $GLOBALS['TSFE']->csConvObj = new \TYPO3\CMS\Core\Charset\CharsetConverter();
                $GLOBALS['TSFE']->renderCharset = 'utf-8';
 
-               $contentObject = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', array('dummy'));
-               $this->subject = $this->getMock('TYPO3\CMS\Frontend\ContentObject\FilesContentObject', array('dummy'), array($contentObject));
+               $contentObject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, array('dummy'));
+               $this->subject = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\FilesContentObject::class, array('dummy'), array($contentObject));
        }
 
        /**
@@ -194,7 +194,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function renderReturnsFilesForFileReferences($configuration, $expected) {
                $fileReferenceMap = array();
                for ($i = 1; $i < 4; $i++) {
-                       $fileReference = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileReference', array(), array(), '', FALSE);
+                       $fileReference = $this->getMock(\TYPO3\CMS\Core\Resource\FileReference::class, array(), array(), '', FALSE);
                        $fileReference->expects($this->any())
                                ->method('getName')
                                ->will($this->returnValue('File ' . $i));
@@ -210,7 +210,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $fileReferenceMap[] = array($i, array(), FALSE, $fileReference);
                }
 
-               $resourceFactory = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
+               $resourceFactory = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceFactory::class);
                $resourceFactory->expects($this->any())
                        ->method('getFileReferenceObject')
                        ->will($this->returnValueMap($fileReferenceMap));
@@ -364,7 +364,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function renderReturnsFilesForFiles($configuration, $expected) {
                $fileMap = array();
                for ($i = 1; $i < 4; $i++) {
-                       $file = $this->getMock('TYPO3\\CMS\\Core\\Resource\\File', array(), array(), '', FALSE);
+                       $file = $this->getMock(\TYPO3\CMS\Core\Resource\File::class, array(), array(), '', FALSE);
                        $file->expects($this->any())
                                ->method('getName')
                                ->will($this->returnValue('File ' . $i));
@@ -380,7 +380,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $fileMap[] = array($i, array(), $file);
                }
 
-               $resourceFactory = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
+               $resourceFactory = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceFactory::class);
                $resourceFactory->expects($this->any())
                        ->method('getFileObject')
                        ->will($this->returnValueMap($fileMap));
@@ -574,7 +574,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                for ($i = 1; $i < 4; $i++) {
                        $fileReferenceArray = array();
                        for ($j = 1; $j < 4; $j++) {
-                               $fileReference = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileReference', array(), array(), '', FALSE);
+                               $fileReference = $this->getMock(\TYPO3\CMS\Core\Resource\FileReference::class, array(), array(), '', FALSE);
                                $fileReference->expects($this->any())
                                        ->method('getName')
                                        ->will($this->returnValue('File ' . $fileCount));
@@ -591,7 +591,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                $fileCount++;
                        }
 
-                       $collection = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Collection\\StaticFileCollection', array(), array(), '', FALSE);
+                       $collection = $this->getMock(\TYPO3\CMS\Core\Resource\Collection\StaticFileCollection::class, array(), array(), '', FALSE);
                        $collection->expects($this->any())
                                ->method('getItems')
                                ->will($this->returnValue($fileReferenceArray));
@@ -599,7 +599,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $collectionMap[] = array($i, $collection);
                }
 
-               $collectionRepository = $this->getMock('TYPO3\\CMS\\Core\\Resource\\FileCollectionRepository');
+               $collectionRepository = $this->getMock(\TYPO3\CMS\Core\Resource\FileCollectionRepository::class);
                $collectionRepository->expects($this->any())
                        ->method('findByUid')
                        ->will($this->returnValueMap($collectionMap));
@@ -793,7 +793,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                for ($i = 1; $i < 4; $i++) {
                        $fileArray = array();
                        for ($j = 1; $j < 4; $j++) {
-                               $file = $this->getMock('TYPO3\\CMS\\Core\\Resource\\File', array(), array(), '', FALSE);
+                               $file = $this->getMock(\TYPO3\CMS\Core\Resource\File::class, array(), array(), '', FALSE);
                                $file->expects($this->any())
                                        ->method('getName')
                                        ->will($this->returnValue('File ' . $fileCount));
@@ -810,7 +810,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                $fileCount++;
                        }
 
-                       $folder = $this->getMock('TYPO3\\CMS\\Core\\Resource\\Folder', array(), array(), '', FALSE);
+                       $folder = $this->getMock(\TYPO3\CMS\Core\Resource\Folder::class, array(), array(), '', FALSE);
                        $folder->expects($this->any())
                                ->method('getFiles')
                                ->will($this->returnValue($fileArray));
@@ -818,7 +818,7 @@ class FilesContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $folderMap[] = array($i . ':myfolder/', $folder);
                }
 
-               $fileFactory = $this->getMock('TYPO3\\CMS\\Core\\Resource\\ResourceFactory');
+               $fileFactory = $this->getMock(\TYPO3\CMS\Core\Resource\ResourceFactory::class);
                $fileFactory->expects($this->any())
                        ->method('getFolderObjectFromCombinedIdentifier')
                        ->will($this->returnValueMap($folderMap));
index a5d96b0..3988002 100644 (file)
@@ -58,16 +58,16 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
        public function setUp() {
                $this->singletonInstances = GeneralUtility::getSingletonInstances();
                $this->contentObjectRenderer = $this->getMock(
-                       'TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer'
+                       \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class
                );
                $this->subject = $this->getAccessibleMock(
-                       'TYPO3\\CMS\\Frontend\\ContentObject\\FluidTemplateContentObject',
+                       \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject::class,
                        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');
+               $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;
        }
 
@@ -83,8 +83,8 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         * Add a mock standalone view to subject
         */
        protected function addMockViewToSubject() {
-               $this->standaloneView = $this->getMock('TYPO3\\CMS\\Fluid\\View\\StandaloneView', array(), array(), '', FALSE);
-               $this->request = $this->getMock('TYPO3\\CMS\\Extbase\\Mvc\\Request');
+               $this->standaloneView = $this->getMock(\TYPO3\CMS\Fluid\View\StandaloneView::class, array(), array(), '', FALSE);
+               $this->request = $this->getMock(\TYPO3\CMS\Extbase\Mvc\Request::class);
                $this->standaloneView
                        ->expects($this->any())
                        ->method('getRequest')
@@ -472,13 +472,13 @@ class FluidTemplateContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                );
 
                /** @var TypoScriptService|\PHPUnit_Framework_MockObject_MockObject $typoScriptServiceMock */
-               $typoScriptServiceMock = $this->getMock('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService');
+               $typoScriptServiceMock = $this->getMock(\TYPO3\CMS\Extbase\Service\TypoScriptService::class);
                $typoScriptServiceMock
                        ->expects($this->once())
                        ->method('convertTypoScriptArrayToPlainArray')
                        ->with($configuration['settings.'])
                        ->will($this->returnValue($expectedSettingsToBeSet));
-               GeneralUtility::setSingletonInstance('TYPO3\\CMS\\Extbase\\Service\\TypoScriptService', $typoScriptServiceMock);
+               GeneralUtility::setSingletonInstance(\TYPO3\CMS\Extbase\Service\TypoScriptService::class, $typoScriptServiceMock);
 
                $this->standaloneView
                        ->expects($this->at(1))
index ba65fe9..a9386aa 100644 (file)
@@ -29,10 +29,10 @@ class AbstractMenuContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Set up this testcase
         */
        public function setUp() {
-               $proxy = $this->buildAccessibleProxy('TYPO3\\CMS\\Frontend\\ContentObject\\Menu\\AbstractMenuContentObject');
+               $proxy = $this->buildAccessibleProxy(\TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject::class);
                $this->fixture = new $proxy();
-               $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection');
-               $GLOBALS['TSFE'] = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(), array($GLOBALS['TYPO3_CONF_VARS'], 1, 1));
+               $GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class);
+               $GLOBALS['TSFE'] = $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array(), array($GLOBALS['TYPO3_CONF_VARS'], 1, 1));
                $GLOBALS['TSFE']->cObj = new \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer();
                $GLOBALS['TSFE']->page = array();
        }
@@ -46,8 +46,8 @@ class AbstractMenuContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @return void
         */
        protected function prepareSectionIndexTest() {
-               $this->fixture->sys_page = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository');
-               $this->fixture->parent_cObj = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
+               $this->fixture->sys_page = $this->getMock(\TYPO3\CMS\Frontend\Page\PageRepository::class);
+               $this->fixture->parent_cObj = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class);
        }
 
        /**
@@ -252,7 +252,7 @@ class AbstractMenuContentObjectTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                }
 
                $this->prepareSectionIndexTest();
-               $this->fixture->parent_cObj = $this->getMock('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer', array());
+               $this->fixture->parent_cObj = $this->getMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, array());
 
                $this->fixture->sys_page->expects($this->once())->method('getMenu')->will($this->returnValue($menu));
                $this->fixture->menuArr = array(
index 96e856c..6f1c02f 100644 (file)
@@ -52,7 +52,7 @@ class DataSubmissionControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                }
 
                $instance = new \TYPO3\CMS\Frontend\Controller\DataSubmissionController(999999999, $lockMethod);
-               $t3libLockReflection = new \ReflectionClass('TYPO3\\CMS\\Frontend\\Controller\\DataSubmissionController');
+               $t3libLockReflection = new \ReflectionClass(\TYPO3\CMS\Frontend\Controller\DataSubmissionController::class);
                $t3libLockReflectionResourceProperty = $t3libLockReflection->getProperty('temporaryFiles');
                $t3libLockReflectionResourceProperty->setAccessible(TRUE);
                $t3libLockReflectionResourceProperty->setValue($instance, array($file));
index 4c5b7d7..98e66e6 100644 (file)
@@ -60,7 +60,7 @@ class TypoScriptFrontendControllerTest extends \TYPO3\CMS\Core\Tests\UnitTestCas
         */
        protected function setupTsfeMockForHeaderFooterReplacementCheck() {
                /** @var \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController $tsfe */
-               $tsfe = $this->getMock('TYPO3\\CMS\\Frontend\\Controller\\TypoScriptFrontendController', array(
+               $tsfe = $this->getMock(\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::class, array(
                        'INTincScript_process',
                        'INTincScript_includeLibs',
                        'INTincScript_loadJSCode',
index 6b4f047..d560c0a 100644 (file)
@@ -36,7 +36,7 @@ class CacheHashCalculatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        'encryptionKey' => $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey']
                );
                $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'] = 't3lib_cacheHashTest';
-               $this->fixture = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator', array('foo'));
+               $this->fixture = $this->getMock(\TYPO3\CMS\Frontend\Page\CacheHashCalculator::class, array('foo'));
                $this->fixture->setConfiguration(array(
                        'excludedParameters' => array('exclude1', 'exclude2'),
                        'cachedParametersWhiteList' => array(),
@@ -171,7 +171,7 @@ class CacheHashCalculatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function canWhitelistParameters($params, $expected) {
-               $method = new \ReflectionMethod('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator', 'setCachedParametersWhiteList');
+               $method = new \ReflectionMethod(\TYPO3\CMS\Frontend\Page\CacheHashCalculator::class, 'setCachedParametersWhiteList');
                $method->setAccessible(TRUE);
                $method->invoke($this->fixture, array('whitep1', 'whitep2'));
                $this->assertEquals($expected, $this->fixture->generateForParameters($params));
index 9e481fa..94dc65d 100644 (file)
@@ -30,8 +30,8 @@ class PageRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Sets up this testcase
         */
        public function setUp() {
-               $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array('exec_SELECTquery', 'sql_fetch_assoc', 'sql_free_result'));
-               $this->pageSelectObject = $this->getAccessibleMock('TYPO3\\CMS\\Frontend\\Page\\PageRepository', array('getMultipleGroupsWhereClause'));
+               $GLOBALS['TYPO3_DB'] = $this->getMock(\TYPO3\CMS\Core\Database\DatabaseConnection::class, array('exec_SELECTquery', 'sql_fetch_assoc', 'sql_free_result'));
+               $this->pageSelectObject = $this->getAccessibleMock(\TYPO3\CMS\Frontend\Page\PageRepository::class, array('getMultipleGroupsWhereClause'));
                $this->pageSelectObject->expects($this->any())->method('getMultipleGroupsWhereClause')->will($this->returnValue(' AND 1=1'));
        }
 
@@ -43,7 +43,7 @@ class PageRepositoryTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
        public function isGetPageHookCalled() {
                // Create a hook mock object
                $className = uniqid('tx_coretest');
-               $getPageHookMock = $this->getMock('TYPO3\\CMS\\Frontend\\Page\\PageRepositoryGetPageHookInterface', array('getPage_preProcess'), array(), $className);
+               $getPageHookMock = $this->getMock(\TYPO3\CMS\Frontend\Page\PageRepositoryGetPageHookInterface::class, array('getPage_preProcess'), array(), $className);
                // Register hook mock object
                $GLOBALS['T3_VAR']['getUserObj'][$className] = $getPageHookMock;
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_page.php']['getPage'][] = $className;
index ac3256c..2e73cd7 100644 (file)
@@ -23,7 +23,7 @@ class AdminPanelViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * Set up
         */
        public function setUp() {
-               $GLOBALS['LANG'] = $this->getMock('TYPO3\\CMS\\Lang\\LanguageService', array(), array(), '', FALSE);
+               $GLOBALS['LANG'] = $this->getMock(\TYPO3\CMS\Lang\LanguageService::class, array(), array(), '', FALSE);
        }
 
        /**
@@ -33,13 +33,13 @@ class AdminPanelViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                $strTime = '2013-01-01 01:00:00';
                $timestamp = strtotime($strTime);
 
-               $backendUser = $this->getMock('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication');
+               $backendUser = $this->getMock(\TYPO3\CMS\Core\Authentication\BackendUserAuthentication::class);
                $backendUser->uc['TSFE_adminConfig']['preview_simulateDate'] = $timestamp;
                unset($backendUser->extAdminConfig['override.']['preview.']);
                unset($backendUser->extAdminConfig['override.']['preview']);
                $GLOBALS['BE_USER'] = $backendUser;
 
-               $adminPanelMock = $this->getMock('TYPO3\\CMS\\Frontend\\View\\AdminPanelView', array('isAdminModuleEnabled','isAdminModuleOpen'), array(), '', FALSE);
+               $adminPanelMock = $this->getMock(\TYPO3\CMS\Frontend\View\AdminPanelView::class, array('isAdminModuleEnabled','isAdminModuleOpen'), array(), '', FALSE);
                $adminPanelMock->expects($this->any())->method('isAdminModuleEnabled')->will($this->returnValue(TRUE));
                $adminPanelMock->expects($this->any())->method('isAdminModuleOpen')->will($this->returnValue(TRUE));
 
@@ -60,7 +60,7 @@ class AdminPanelViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                eval('class ' . $hookClass . ' {}');
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'][] = $hookClass;
                /** @var $adminPanelMock \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Frontend\View\AdminPanelView */
-               $adminPanelMock = $this->getMock('TYPO3\\CMS\\Frontend\\View\\AdminPanelView', array('dummy'), array(), '', FALSE);
+               $adminPanelMock = $this->getMock(\TYPO3\CMS\Frontend\View\AdminPanelView::class, array('dummy'), array(), '', FALSE);
                $adminPanelMock->display();
        }
 
@@ -69,12 +69,12 @@ class AdminPanelViewTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        public function extendAdminPanelHookCallsExtendAdminPanelMethodOfHook() {
                $hookClass = uniqid('tx_coretest');
-               $hookMock = $this->getMock('TYPO3\\CMS\\Frontend\\View\\AdminPanelViewHookInterface', array(), array(), $hookClass);
+               $hookMock = $this->getMock(\TYPO3\CMS\Frontend\View\AdminPanelViewHookInterface::class, array(), array(), $hookClass);
                $GLOBALS['T3_VAR']['getUserObj'][$hookClass] = $hookMock;
                $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_adminpanel.php']['extendAdminPanel'][] = $hookClass;
                /** @var $adminPanelMock \PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Frontend\View\AdminPanelView */
-               $adminPanelMock = $this->getMock('TYPO3\\CMS\\Frontend\\View\\AdminPanelView', array('extGetLL'), array(), '', FALSE);
-               $hookMock->expects($this->once())->method('extendAdminPanel')->with($this->isType('string'), $this->isInstanceOf('TYPO3\\CMS\\Frontend\\View\\AdminPanelView'));
+               $adminPanelMock = $this->getMock(\TYPO3\CMS\Frontend\View\AdminPanelView::class, array('extGetLL'), array(), '', FALSE);
+               $hookMock->expects($this->once())->method('extendAdminPanel')->with($this->isType('string'), $this->isInstanceOf(\TYPO3\CMS\Frontend\View\AdminPanelView::class));
                $adminPanelMock->display();
        }
 
index 9f13c33..8b0c7dd 100644 (file)
@@ -3,9 +3,9 @@ defined('TYPO3_MODE') or die();
 
 if (TYPO3_MODE === 'FE' && !isset($_REQUEST['eID'])) {
        \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\SignalSlot\Dispatcher::class)->connect(
-               'TYPO3\\CMS\\Core\\Resource\\Index\\MetaDataRepository',
+               \TYPO3\CMS\Core\Resource\Index\MetaDataRepository::class,
                'recordPostRetrieval',
-               'TYPO3\\CMS\\Frontend\\Aspect\\FileMetadataOverlayAspect',
+               \TYPO3\CMS\Frontend\Aspect\FileMetadataOverlayAspect::class,
                'languageAndWorkspaceOverlay'
        );
 }
@@ -25,5 +25,5 @@ if (TYPO3_MODE === 'FE') {
        $GLOBALS['TYPO3_CONF_VARS']['FE']['eID_include']['ExtDirect'] = 'EXT:frontend/Resources/PHP/Eid/ExtDirect.php';
 
        // Register the core media wizard provider
-       \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::registerMediaWizardProvider('TYPO3\\CMS\\Frontend\\MediaWizard\\MediaWizardProvider');
+       \TYPO3\CMS\Frontend\MediaWizard\MediaWizardProviderManager::registerMediaWizardProvider(\TYPO3\CMS\Frontend\MediaWizard\MediaWizardProvider::class);
 }