-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TASK] run content_defender tests on v13
- Loading branch information
1 parent
89a603b
commit 73d1412
Showing
6 changed files
with
40 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Tests/Functional/Datahandler/ContentDefender/AbstractContentDefender.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace B13\Container\Tests\Functional\Datahandler\ContentDefender; | ||
|
||
/* | ||
* This file is part of TYPO3 CMS-based extension "container" by b13. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
*/ | ||
|
||
use B13\Container\Tests\Functional\Datahandler\AbstractDatahandler; | ||
use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; | ||
use TYPO3\CMS\Core\Http\ServerRequest; | ||
use TYPO3\CMS\Core\Information\Typo3Version; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
abstract class AbstractContentDefender extends AbstractDatahandler | ||
{ | ||
protected function setUp(): void | ||
{ | ||
parent::setUp(); | ||
if ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() === 12) { | ||
// content_defender calls FormDataCompiler which wants access global variable TYPO3_REQUEST | ||
$GLOBALS['TYPO3_REQUEST'] = null; | ||
} elseif ((GeneralUtility::makeInstance(Typo3Version::class))->getMajorVersion() > 12) { | ||
// content_defender always returns true for restrictions if global variable TYPO3_REQUEST is null | ||
$GLOBALS['TYPO3_REQUEST'] = (new ServerRequest())->withAttribute('applicationType', SystemEnvironmentBuilder::REQUESTTYPE_BE); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters