Skip to content

Commit

Permalink
[BUGFIX] Flush site configuration caches in TYPO3v9+
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrodala committed Sep 17, 2020
1 parent 49365b8 commit a06d274
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Tests/Functional/AbstractElasticsearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
use PAGEmachine\Searchable\Connection;
use PAGEmachine\Searchable\Indexer\PagesIndexer;
use PAGEmachine\Searchable\Service\IndexingService;
use TYPO3\CMS\Core\Configuration\SiteConfiguration;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Crypto\Random;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -97,6 +99,14 @@ protected function setUp()
__DIR__ . '/Fixtures/TypoScript/page.typoscript',
'EXT:searchable/Configuration/Typoscript/setup.txt',
]);
// Update internally created site to flush all caches
if (class_exists(SiteConfiguration::class)) {
$siteConfiguration = GeneralUtility::makeInstance(
SiteConfiguration::class,
Environment::getConfigPath() . '/sites'
);
$siteConfiguration->write('1', $siteConfiguration->load('1'));
}

// Necessary for \TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseUserPermissionCheck
$this->setUpBackendUserFromFixture(1);
Expand Down

0 comments on commit a06d274

Please sign in to comment.