Skip to content
Snippets Groups Projects
Commit 5c649c93 authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[TASK] Use Backend User fixture for DataHandler tests

Resolves: #56070
Releases: 6.2
Change-Id: Iaae9944796311d7e453b5374827acf7030e6bdbf
Reviewed-on: https://review.typo3.org/27681
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
parent c5271d60
Branches
Tags
No related merge requests found
......@@ -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();
}
......
......@@ -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;
}
/**
......
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