diff --git a/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php b/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php index 6ce922237fcd2870e9b7b3565cab3ab7b2897d06..5fd0e3ce34db244bc6850f91de8b461491684903 100644 --- a/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php +++ b/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php @@ -32,6 +32,8 @@ use TYPO3\CMS\Core\Tests\Functional\DataHandling\Framework\DataSet; */ abstract class AbstractDataHandlerActionTestCase extends \TYPO3\CMS\Core\Tests\FunctionalTestCase { + const VALUE_BackendUserId = 1; + /** * @var string */ @@ -65,15 +67,11 @@ abstract class AbstractDataHandlerActionTestCase extends \TYPO3\CMS\Core\Tests\F public function setUp() { parent::setUp(); - $this->backendUser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Authentication\\BackendUserAuthentication'); - $this->backendUser->user['admin'] = 1; - $this->backendUser->user['uid'] = 1; + $this->backendUser = $this->setUpBackendUserFromFixture(self::VALUE_BackendUserId); // By default make tests on live workspace $this->backendUser->workspace = 0; - $GLOBALS['BE_USER'] = $this->backendUser; $this->actionService = $this->getActionService(); - \TYPO3\CMS\Core\Core\Bootstrap::getInstance()->initializeLanguageObject(); } diff --git a/typo3/sysext/core/Tests/FunctionalTestCase.php b/typo3/sysext/core/Tests/FunctionalTestCase.php index 419e6da0b29b8c7eaf71c2a1f6af54a8556d0ac5..aa9204970eed9359820421c1b8f4077916edd1a4 100644 --- a/typo3/sysext/core/Tests/FunctionalTestCase.php +++ b/typo3/sysext/core/Tests/FunctionalTestCase.php @@ -188,6 +188,7 @@ abstract class FunctionalTestCase extends BaseTestCase { * Initialize backend user * * @param int $userUid uid of the user we want to initialize. This user must exist in the fixture file + * @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication * @throws Exception */ protected function setUpBackendUserFromFixture($userUid) { @@ -213,6 +214,8 @@ abstract class FunctionalTestCase extends BaseTestCase { ); } $GLOBALS['BE_USER']->backendCheckLogin(); + + return $backendUser; } /**