Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ jobs:
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s functional
if: matrix.TYPO3 != '14'

- name: Functional Tests 14
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s functional -- --exclude-group content_defender
if: matrix.TYPO3 == '14'

- name: Acceptance Tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s acceptance -- --fail-fast
if: matrix.TYPO3 != '14'
Expand Down
5 changes: 1 addition & 4 deletions Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -641,10 +641,7 @@ case ${TEST_SUITE} in
mv composer.json.orig composer.json
;;
functional)
PHPUNIT_EXCLUDE_GROUPS+=",not-${DBMS}"
PHPUNIT_EXCLUDE_GROUPS="${PHPUNIT_EXCLUDE_GROUPS#,}"
PHPUNIT_EXCLUDE_GROUPS="${PHPUNIT_EXCLUDE_GROUPS%,}"
COMMAND=(.Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group ${PHPUNIT_EXCLUDE_GROUPS} "$@")
COMMAND=(.Build/bin/phpunit -c Build/phpunit/FunctionalTests.xml --exclude-group not-${DBMS} "$@")
case ${DBMS} in
mariadb)
echo "Using driver: ${DATABASE_DRIVER}"
Expand Down
21 changes: 20 additions & 1 deletion Build/phpstan-baseline-11-7.4.neon
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,23 @@ parameters:
-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordFactory not found\\.$#"
count: 1
path: ../Classes/Backend/Grid/ContainerGridColumnItem.php
path: ../Classes/Backend/Grid/ContainerGridColumnItem.php
-
message: "#^Class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor invoked with 4 parameters, 2 required\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Backend\\\\Context\\\\PageContext not found\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Backend\\\\Domain\\\\Model\\\\Language\\\\PageLanguageInformation not found\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Parameter \\#1 \\$pageRecord of class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor expects array, TYPO3\\\\CMS\\\\Backend\\\\Context\\\\PageContext given\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php
21 changes: 20 additions & 1 deletion Build/phpstan-baseline-11.neon
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,23 @@ parameters:
-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordFactory not found\\.$#"
count: 1
path: ../Classes/Backend/Grid/ContainerGridColumnItem.php
path: ../Classes/Backend/Grid/ContainerGridColumnItem.php
-
message: "#^Class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor invoked with 4 parameters, 2 required\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Backend\\\\Context\\\\PageContext not found\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Backend\\\\Domain\\\\Model\\\\Language\\\\PageLanguageInformation not found\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Parameter \\#1 \\$pageRecord of class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor expects array, TYPO3\\\\CMS\\\\Backend\\\\Context\\\\PageContext given\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php
21 changes: 20 additions & 1 deletion Build/phpstan-baseline-12.neon
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,23 @@ parameters:
-
message: "#^Class TYPO3\\\\CMS\\\\Core\\\\Domain\\\\RecordFactory not found\\.$#"
count: 1
path: ../Classes/Backend/Grid/ContainerGridColumnItem.php
path: ../Classes/Backend/Grid/ContainerGridColumnItem.php
-
message: "#^Class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor invoked with 4 parameters, 2 required\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Backend\\\\Context\\\\PageContext not found\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Backend\\\\Domain\\\\Model\\\\Language\\\\PageLanguageInformation not found\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Parameter \\#1 \\$pageRecord of class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor expects array, TYPO3\\\\CMS\\\\Backend\\\\Context\\\\PageContext given\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php
29 changes: 29 additions & 0 deletions Build/phpstan-baseline-13.neon
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,32 @@ parameters:
message: "#^Cannot call method toArray\\(\\) on array\\.$#"
count: 1
path: ../Classes/Listener/PageContentPreviewRendering.php
-
message: "#^Class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor invoked with 4 parameters, 5 required\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Backend\\\\Context\\\\PageContext not found\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Instantiated class TYPO3\\\\CMS\\\\Backend\\\\Domain\\\\Model\\\\Language\\\\PageLanguageInformation not found\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Parameter \\#1 \\$pageRecord of class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor expects array, TYPO3\\\\CMS\\\\Backend\\\\Context\\\\PageContext given\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Parameter \\#3 \\$site of class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor expects TYPO3\\\\CMS\\\\Core\\\\Site\\\\Entity\\\\SiteInterface, PHPUnit\\\\Framework\\\\MockObject\\\\MockObject&TYPO3\\\\CMS\\\\Backend\\\\View\\\\Drawing\\\\DrawingConfiguration given\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php

-
message: "#^Parameter \\#4 \\$drawingConfiguration of class TYPO3\\\\CMS\\\\Backend\\\\View\\\\PageLayoutContext constructor expects TYPO3\\\\CMS\\\\Backend\\\\View\\\\Drawing\\\\DrawingConfiguration, PHPUnit\\\\Framework\\\\MockObject\\\\MockObject&TYPO3\\\\CMS\\\\Core\\\\Http\\\\ServerRequest given\\.$#"
count: 1
path: ../Tests/Functional/Integrity/IntegrityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ public static function localizeKeepsSortingDataProvider(): array
4 => ['copyToLanguage' => 1],
1 => ['copyToLanguage' => 1],
],
], 'Dataset1'],
], 'dataset' => 'Dataset1'],
['cmdmap' => [
'tt_content' => [
1 => ['copyToLanguage' => 1],
4 => ['copyToLanguage' => 1],
],
], 'Dataset2'],
], 'dataset' => 'Dataset2'],
];
}

Expand Down
52 changes: 32 additions & 20 deletions Tests/Functional/Datahandler/Localization/LocalizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,18 +212,24 @@ public function localizeChildKeepsRelationsIfContainerIsInConnectedMode(): void
public static function localizeTwoContainerKeepsParentIndependedOnOrderDataProvider(): array
{
return [
['cmdmap' => [
'tt_content' => [
91 => ['localize' => 1],
1 => ['localize' => 1],
[
'cmdmap' => [
'tt_content' => [
91 => ['localize' => 1],
1 => ['localize' => 1],
],
],
], 'Dataset1'],
['cmdmap' => [
'tt_content' => [
1 => ['localize' => 1],
91 => ['localize' => 1],
'dataset' => 'Dataset1',
],
[
'cmdmap' => [
'tt_content' => [
1 => ['localize' => 1],
91 => ['localize' => 1],
],
],
], 'Dataset2'],
'dataset' => 'Dataset2',
],
];
}

Expand All @@ -245,18 +251,24 @@ public function localizeTwoContainerKeepsParentIndependedOnOrder(array $cmdmap,
public static function localizeWithCopyTwoContainerChangeParentIndependedOnOrderDataProvider(): array
{
return [
['cmdmap' => [
'tt_content' => [
91 => ['copyToLanguage' => 1],
1 => ['copyToLanguage' => 1],
[
'cmdmap' => [
'tt_content' => [
91 => ['copyToLanguage' => 1],
1 => ['copyToLanguage' => 1],
],
],
], 'Dataset1'],
['cmdmap' => [
'tt_content' => [
1 => ['copyToLanguage' => 1],
91 => ['copyToLanguage' => 1],
'dataset' => 'Dataset1',
],
[
'cmdmap' => [
'tt_content' => [
1 => ['copyToLanguage' => 1],
91 => ['copyToLanguage' => 1],
],
],
], 'Dataset2'],
'dataset' => 'Dataset2',
],
];
}

Expand Down
13 changes: 13 additions & 0 deletions Tests/Functional/Frontend/AbstractFrontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@
*/

use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Cache\Backend\NullBackend;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequest;
use TYPO3\TestingFramework\Core\Functional\Framework\Frontend\InternalRequestContext;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

abstract class AbstractFrontend extends FunctionalTestCase
{
protected array $configurationToUseInTestInstance = [
'SYS' => [
'caching' => [
'cacheConfigurations' => [
'fluid_template' => [
'backend' => NullBackend::class,
],
],
],
],
];

/**
* @var non-empty-string[]
*/
Expand Down
38 changes: 35 additions & 3 deletions Tests/Functional/Integrity/IntegrityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
use B13\Container\Integrity\Error\WrongPidError;
use B13\Container\Integrity\Integrity;
use B13\Container\Integrity\IntegrityFix;
use TYPO3\CMS\Backend\Context\PageContext;
use TYPO3\CMS\Backend\Domain\Model\Language\PageLanguageInformation;
use TYPO3\CMS\Backend\View\BackendLayout\BackendLayout;
use TYPO3\CMS\Backend\View\BackendLayout\ContentFetcher;
use TYPO3\CMS\Backend\View\Drawing\DrawingConfiguration;
Expand All @@ -25,6 +27,7 @@
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Localization\LanguageServiceFactory;
use TYPO3\CMS\Core\Site\Entity\Site;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;

Expand Down Expand Up @@ -86,14 +89,43 @@ public function wrongPidErrorElementsAreShownAsUnusedElements(): void
->fetchAssociative();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 12) {
$pageLayoutContext = new PageLayoutContext($pageRecord, $backendLayout);
$contentFetcher = new ContentFetcher($pageLayoutContext);
$unusedRecords = $contentFetcher->getUnusedRecords();
} else {
$site = $this->getMockBuilder(Site::class)->disableOriginalConstructor()->getMock();
$drawingConfiguration = $this->getMockBuilder(DrawingConfiguration::class)->disableOriginalConstructor()->getMock();
$serverRequest = $this->getMockBuilder(ServerRequest::class)->disableOriginalConstructor()->getMock();
$pageLayoutContext = new PageLayoutContext($pageRecord, $backendLayout, $site, $drawingConfiguration, $serverRequest);
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 14) {
$pageLayoutContext = new PageLayoutContext($pageRecord, $backendLayout, $site, $drawingConfiguration, $serverRequest);
$contentFetcher = new ContentFetcher($pageLayoutContext);
$unusedRecords = $contentFetcher->getUnusedRecords();
} else {
$pageLanguageInformation = new PageLanguageInformation(
$pageRecord['uid'],
[],
[],
[],
[0],
false,
[]
);
$pageContext = new PageContext(
$pageRecord['uid'],
$pageRecord,
$site,
[],
[],
[],
$pageLanguageInformation,
new Permission()
);
$pageLayoutContext = new PageLayoutContext($pageContext, $backendLayout, $drawingConfiguration, $serverRequest);
$container = $this->get('service_container');
$contentFetcher = $container->get(ContentFetcher::class);
$unusedRecords = $contentFetcher->getUnusedRecords($pageLayoutContext);
}
}
$contentFetcher = new ContentFetcher($pageLayoutContext);
$unusedRecords = $contentFetcher->getUnusedRecords();

$unusedRecordsArr = [];
foreach ($unusedRecords as $unusedRecord) {
$unusedRecordsArr[] = $unusedRecord;
Expand Down
Loading