Skip to content

Commit

Permalink
[TASK] Initialize language object in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrodala committed Sep 6, 2023
1 parent 26bffa5 commit 0ff5f6f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Tests/Functional/Hook/DataHandler/AddRedirectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Pagemachine\FlatUrls\Tests\Functional\Hook\DataHandler;

use TYPO3\CMS\Core\Configuration\SiteConfiguration;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -32,6 +33,8 @@ public function addsRedirectsOnSlugChange(array $pages, array $changes, array $e
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$pageConnection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$pageConnection->insert('pages', [
Expand Down Expand Up @@ -152,6 +155,8 @@ public function skipsPagesWithoutSite(): void
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$pageConnection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$pageConnection->insert('pages', [
Expand Down Expand Up @@ -186,6 +191,8 @@ public function skipsInactivePages(): void
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$pageConnection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$pageConnection->insert('pages', [
Expand Down
3 changes: 3 additions & 0 deletions Tests/Functional/Hook/DataHandler/AmendSlugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Pagemachine\FlatUrls\Tests\Functional\Hook\DataHandler;

use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -32,6 +33,8 @@ public function ensuresFlatUrls(array $changes, int $pageUid, string $expected):
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$connection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$connection->insert('pages', [
Expand Down
3 changes: 3 additions & 0 deletions Tests/Functional/Hook/DataHandler/RefreshSlugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Pagemachine\FlatUrls\Tests\Functional\Hook\DataHandler;

use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand Down Expand Up @@ -31,6 +32,8 @@ public function ensuresFlatUrls(array $pages, array $changes, int $pageUid, stri
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$connection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$connection->insert('pages', [
Expand Down
11 changes: 11 additions & 0 deletions Tests/Functional/Hook/DataHandler/ResolveRedirectConflictTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Configuration\SiteConfiguration;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\DataHandling\DataHandler;
use TYPO3\CMS\Core\Utility\GeneralUtility;
Expand All @@ -32,6 +33,8 @@ public function resolvesPagePathRedirectConflicts(): void
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$pageConnection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$pageConnection->insert('pages', [
Expand Down Expand Up @@ -111,6 +114,8 @@ public function normalizesPagePath(): void
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$pageConnection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$pageConnection->insert('pages', [
Expand Down Expand Up @@ -192,6 +197,8 @@ public function resolvesUidRedirectConflicts(): void
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$pageConnection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$pageConnection->insert('pages', [
Expand Down Expand Up @@ -232,6 +239,8 @@ public function skipsPagesWithoutSite(): void
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$pageConnection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');

Expand Down Expand Up @@ -265,6 +274,8 @@ public function skipsInactivePages(): void
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$pageConnection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');
$pageConnection->insert('pages', [
Expand Down
3 changes: 3 additions & 0 deletions Tests/Functional/Page/Slug/PageSlugProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Pagemachine\FlatUrls\Page\Page;
use Pagemachine\FlatUrls\Page\Slug\PageSlugProcessor;
use TYPO3\CMS\Core\Core\Bootstrap;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
Expand All @@ -32,6 +33,8 @@ public function updatesPageSlugs(array $pages, int $pageUid, string $expected):
$this->importCSVDataSet(__DIR__ . '/../../Fixtures/be_users.csv');
$this->setUpBackendUser(1);

Bootstrap::initializeLanguageObject();

$connection = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('pages');

Expand Down

0 comments on commit 0ff5f6f

Please sign in to comment.