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: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ jobs:
- name: Acceptance Tests
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s acceptance -- --fail-fast
if: matrix.TYPO3 != '14'

- name: Acceptance Tests 14
run: Build/Scripts/runTests.sh -p ${{ matrix.php }} -t ${{ matrix.TYPO3 }} -s acceptance -- --fail-fast --skip-group=content_defender
if: matrix.TYPO3 == '14'
- name: Archive acceptance tests results
uses: actions/upload-artifact@v4
if: always()
Expand Down
3 changes: 2 additions & 1 deletion Build/Scripts/runTests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ while getopts "a:b:s:d:i:t:p:xy:o:nhug" OPT; do
fi
# @todo Remove USE_APACHE option when TF7 has been dropped (along with TYPO3 v11 support).
[[ "${TYPO3}" -eq 13 ]] && USE_APACHE=1
[[ "${TYPO3}" -eq 14 ]] && USE_APACHE=1
;;
p)
PHP_VERSION=${OPTARG}
Expand Down Expand Up @@ -600,7 +601,7 @@ case ${TEST_SUITE} in
composer require typo3/cms-core:^11.5 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer prepare-tests
elif [ ${TYPO3} -eq 13 ]; then
composer require typo3/cms-core:^13.4 typo3/testing-framework:^8.2 phpunit/phpunit:^10.5 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer require typo3/cms-core:^13.4 typo3/testing-framework:^9 phpunit/phpunit:^11 ichhabrecht/content-defender --dev -W --no-progress --no-interaction
composer prepare-tests
elif [ ${TYPO3} -eq 14 ]; then
composer require typo3/cms-core:^14.0 --dev -W --no-progress --no-interaction
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ See Tests/README.md on how to run the tests locally (like how github-actions run

To assure coding guidelines are fullfilled:

- run ``.Build/bin/phpstan analyse -c Build/phpstan10.neon``
- run ``.Build/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no``
- run ``php -d memory_limit=2G .Build/bin/phpstan analyse -c Build/phpstan14.neon``
- run ``php -d memory_limit=2G .Build/bin/php-cs-fixer fix --config=Build/php-cs-fixer.php --dry-run --stop-on-violation --using-cache=no``

## Credits

Expand Down
28 changes: 14 additions & 14 deletions Tests/Acceptance/Backend/ContentDefenderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function _before(BackendTester $I)
*/
public function canCreateChildIn2ColsContainerWithNoContentDefenderRestrictionsDefined(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13): void
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'pageWithDifferentContainers']);
Expand All @@ -46,7 +46,7 @@ public function canCreateChildIn2ColsContainerWithNoContentDefenderRestrictionsD
$colPosSelector = '#element-tt_content-300 [data-colpos="' . $dataColPos . '"]';
$I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
$I->waitForModal();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
$I->executeJS("document.querySelector('" . $I->getNewRecordWizardSelector() . "').shadowRoot.querySelector('button[data-identifier=\"default\"]').click()");
}
Expand All @@ -60,7 +60,7 @@ public function canCreateChildIn2ColsContainerWithNoContentDefenderRestrictionsD
*/
public function doNotSeeNotAllowedContentElementsInNewContentElementWizard(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13): void
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'pageWithContainer-3']);
Expand All @@ -73,7 +73,7 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizard(Backe
$colPosSelector = '#element-tt_content-800 [data-colpos="' . $dataColPos . '"]';
$I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
$I->waitForModal();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
$I->executeJS("document.querySelector('" . $I->getNewRecordWizardSelector() . "').shadowRoot.querySelector('button[data-identifier=\"default\"]').click()");
}
Expand All @@ -86,7 +86,7 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizard(Backe
*/
public function doNotSeeNotAllowedContentElementsInNewContentElementWizardTriggeredByContextMenu(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13): void
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'pageWithContainer-3']);
Expand Down Expand Up @@ -127,7 +127,7 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizardTrigge
}

$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
$I->waitForModal();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
$I->executeJS("document.querySelector('" . $I->getNewRecordWizardSelector() . "').shadowRoot.querySelector('button[data-identifier=\"default\"]').click()");
}
Expand All @@ -140,7 +140,7 @@ public function doNotSeeNotAllowedContentElementsInNewContentElementWizardTrigge
*/
public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewElement(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13)
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'pageWithContainer-4']);
Expand All @@ -153,7 +153,7 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewEl
$colPosSelector = '#element-tt_content-801 [data-colpos="' . $dataColPos . '"]';
$I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
$I->waitForModal();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
$I->executeJS("document.querySelector('" . $I->getNewRecordWizardSelector() . "').shadowRoot.querySelector('button[data-identifier=\"default\"]').click()");
}
Expand All @@ -179,7 +179,7 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenCreateNewEl
*/
public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenEditAnElement(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13)
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'contentTCASelectCtype']);
Expand All @@ -200,7 +200,7 @@ public function doNotSeeNotAllowedContentElementsInCTypeSelectBoxWhenEditAnEleme
*/
public function canSeeNewContentButtonIfMaxitemsIsNotReached(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13)
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'contentDefenderMaxitems']);
Expand All @@ -219,7 +219,7 @@ public function canSeeNewContentButtonIfMaxitemsIsNotReached(BackendTester $I, P
*/
public function canNotSeeNewContentButtonIfMaxitemsIsReached(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13)
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'contentDefenderMaxitems']);
Expand All @@ -239,7 +239,7 @@ public function canNotSeeNewContentButtonIfMaxitemsIsReached(BackendTester $I, P
*/
public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13)
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'contentDefenderMaxitems']);
Expand All @@ -252,7 +252,7 @@ public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer(
$colPosSelector = '#element-tt_content-402 [data-colpos="' . $dataColPos . '"]';
$I->clickNewContentElement($colPosSelector);
$I->switchToIFrame();
$I->waitForElement('.modal-dialog');
$I->waitForModal();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() > 12) {
$I->executeJS("document.querySelector('" . $I->getNewRecordWizardSelector() . "').shadowRoot.querySelector('button[data-identifier=\"default\"]').click()");
}
Expand All @@ -277,7 +277,7 @@ public function canCreateNewChildInContainerIfMaxitemsIsReachedInOtherContainer(
*/
public function seeEditDocumentWhenAddingChildrenToColposWhereOnlyHeaderIsAllowed(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13)
{
$I->click('Page');
$I->clickLayoutModuleButton();
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'pageWithDifferentContainers']);
Expand Down
6 changes: 2 additions & 4 deletions Tests/Acceptance/Backend/EditorLayoutCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
use B13\Container\Tests\Acceptance\Support\BackendTester;
use B13\Container\Tests\Acceptance\Support\PageTree;
use B13\Container\Tests\Acceptance\Support\PageTreeV13;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;

class EditorLayoutCest
{
Expand All @@ -30,8 +28,8 @@ public function _before(BackendTester $I)

public function canSeeNewContentButton(BackendTester $I, PageTree $pageTree, PageTreeV13 $pageTreeV13)
{
$I->click('Page');
if (GeneralUtility::makeInstance(Typo3Version::class)->getMajorVersion() < 13) {
$I->clickLayoutModuleButton();
if ($I->getTypo3MajorVersion() < 13) {
$I->waitForElement('#typo3-pagetree-tree .nodes .node');
$pageTree->openPath(['home', 'pageWithContainer-5']);
} else {
Expand Down
4 changes: 1 addition & 3 deletions Tests/Acceptance/Backend/InfoModuleCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
use B13\Container\Tests\Acceptance\Support\BackendTester;
use B13\Container\Tests\Acceptance\Support\PageTree;
use Codeception\Scenario;
use TYPO3\CMS\Core\Information\Typo3Version;

class InfoModuleCest
{
Expand All @@ -29,8 +28,7 @@ public function _before(BackendTester $I)

public function canSeeContainerPageTsConfig(BackendTester $I, PageTree $pageTree, Scenario $scenario)
{
$typo3Version = new Typo3Version();
if ($typo3Version->getMajorVersion() >= 12) {
if ($I->getTypo3MajorVersion() >= 12) {
$scenario->skip('PageTsConfigModuleCest is used');
}
$I->click('Info');
Expand Down
Loading
Loading