Skip to content

Commit

Permalink
WIP: fixed functional and unit tests, fix code styles and code compat…
Browse files Browse the repository at this point in the history
…ibility
  • Loading branch information
AndreAOE committed Jul 23, 2024
1 parent e19ab24 commit 04af7dd
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
29 changes: 21 additions & 8 deletions Classes/Controller/BackendModuleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Aoe\Cachemgm\Utility\CacheUtility;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Backend\Template\ModuleTemplateFactory;
use TYPO3\CMS\Backend\View\BackendTemplateView;
use TYPO3\CMS\Core\Cache\Backend\BackendInterface;
use TYPO3\CMS\Core\Cache\Backend\SimpleFileBackend;
use TYPO3\CMS\Core\Cache\Backend\Typo3DatabaseBackend;
Expand All @@ -44,6 +43,7 @@
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
use TYPO3\CMS\Extbase\Mvc\Exception\NoSuchArgumentException;
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
use TYPO3\CMS\Fluid\View\TemplatePaths;

class BackendModuleController extends ActionController
{
Expand All @@ -54,15 +54,13 @@ class BackendModuleController extends ActionController

/**
* BackendTemplateContainer
*
* @var BackendTemplateView
*/
protected $view;

/**
* @var CacheManager
*/
private object $cacheManager;
private readonly object $cacheManager;

/**
* @var LanguageService
Expand Down Expand Up @@ -145,11 +143,26 @@ public function flushAction(): ResponseInterface
return new ForwardResponse('index');
}

protected function initializeView($view): void
protected function initializeView(): void
{
$this->view->setLayoutRootPaths(['EXT:cachemgm/Resources/Private/Layouts']);
$this->view->setPartialRootPaths(['EXT:cachemgm/Resources/Private/Partials']);
$this->view->setTemplateRootPaths(['EXT:cachemgm/Resources/Private/Templates/BackendModule']);
/*
$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$templatePaths = new TemplatePaths();
$templatePaths->setLayoutRootPaths(['EXT:cachemgm/Resources/Private/Layouts']);
$templatePaths->setPartialRootPaths(['EXT:cachemgm/Resources/Private/Partials']);
$templatePaths->setTemplateRootPaths(['EXT:cachemgm/Resources/Private/Templates/BackendModule']);
$moduleTemplate->setContent($this->view->setTemplatePaths($templatePaths));
*/

if ($this->view instanceof \TYPO3\CMS\Fluid\View\StandaloneView) {
$this->view->setLayoutRootPaths(['EXT:cachemgm/Resources/Private/Layouts']);
$this->view->setPartialRootPaths(['EXT:cachemgm/Resources/Private/Partials']);
$this->view->setTemplateRootPaths(['EXT:cachemgm/Resources/Private/Templates/BackendModule']);
}

$moduleTemplate = $this->moduleTemplateFactory->create($this->request);
$moduleTemplate->setContent($this->view->render());
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/Functional/FunctionalTests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
bootstrap="../../.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
backupGlobals="true"
colors="true"
processIsolation="false"
processIsolation="true"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
Expand Down
1 change: 1 addition & 0 deletions Tests/Unit/Utility/CacheUtilityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class CacheUtilityTest extends UnitTestCase
{
protected function setUp(): void
{
parent::setUp();
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations'] = [
'cache_core' => [
'frontend' => PhpFrontend::class,
Expand Down
14 changes: 0 additions & 14 deletions code-quality/phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -1,16 +1,2 @@
parameters:
ignoreErrors:
-
message: "#^Anonymous variable in a `\\$queryBuilder\\-\\>count\\('\\*'\\)\\-\\>\\.\\.\\.\\(\\)` method call can lead to false dead methods\\. Make sure the variable type is known$#"
count: 1
path: ../Classes/Domain/Repository/AbstractRepository.php

-
message: "#^Anonymous variable in a `\\$queryBuilder\\-\\>count\\('\\*'\\)\\-\\>from\\(\\$table\\)\\-\\>\\.\\.\\.\\(\\)` method call can lead to false dead methods\\. Make sure the variable type is known$#"
count: 1
path: ../Classes/Domain/Repository/AbstractRepository.php

-
message: "#^Anonymous variable in a `\\$queryBuilder\\-\\>count\\('\\*'\\)\\-\\>from\\(\\$table\\)\\-\\>execute\\(\\)\\-\\>\\.\\.\\.\\(\\)` method call can lead to false dead methods\\. Make sure the variable type is known$#"
count: 1
path: ../Classes/Domain/Repository/AbstractRepository.php
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
}
],
"require": {
"php": "^8.0",
"php": "^8.1",
"typo3/cms-core": "^12.4",
"typo3/cms-backend": "^12.4",
"typo3/cms-frontend": "^12.4",
"psr/http-message": "^1.0"
},
"require-dev": {
"typo3/testing-framework": "^7.0",
"typo3/testing-framework": "^8.0",
"phpcompatibility/php-compatibility": "^9.3",
"phpstan/phpstan": "^1.10",
"rector/rector": "^1.0",
Expand Down Expand Up @@ -85,7 +85,7 @@
"./.Build/bin/phpstan analyse -c code-quality/phpstan.neon --memory-limit=1G --generate-baseline"
],
"code-compatibility": [
"[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer install",
"[ -e ./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs ] || composer update",
"[ -d ./reports/php_checkstyle ] || mkdir -p reports/php_checkstyle/",
"./code-quality/configure-checkstyle.sh",
"./.Build/vendor/symplify/easy-coding-standard/vendor/squizlabs/php_codesniffer/bin/phpcs -d memory_limit=1G --standard=PHPCompatibility --colors --ignore=*/.Build/*,*.min.js -p . --runtime-set testVersion 8.3"
Expand Down

0 comments on commit 04af7dd

Please sign in to comment.