-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TASK: Add frontend tests for b13/container extension (#1)
- Loading branch information
1 parent
41c2179
commit 26d634c
Showing
37 changed files
with
1,128 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,3 +100,54 @@ jobs: | |
- name: Code Quality (by PHPStan) | ||
run: ./vendor/bin/phpstan analyse | ||
|
||
tests-mysql: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- php-linting | ||
- xml-linting | ||
strategy: | ||
matrix: | ||
include: | ||
- php-version: '8.1' | ||
typo3-version: '^12.4' | ||
db-version: '8' | ||
- php-version: '8.2' | ||
typo3-version: '^12.4' | ||
db-version: '8' | ||
- php-version: '8.3' | ||
typo3-version: '^12.4' | ||
db-version: '8' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
tools: composer:v2 | ||
|
||
- name: Setup MySQL | ||
uses: mirromutth/[email protected] | ||
with: | ||
mysql version: "${{ matrix.db-version }}" | ||
mysql database: 'typo3' | ||
mysql root password: 'root' | ||
|
||
- name: Wait for MySQL | ||
run: | | ||
while ! mysqladmin ping --host=127.0.0.1 --password=root --silent; do | ||
sleep 1 | ||
done | ||
- name: Install dependencies | ||
run: composer require --no-interaction --prefer-dist --no-progress "typo3/cms-backend:${{ matrix.typo3-version }}" "typo3/cms-core:${{ matrix.typo3-version }}" "typo3/cms-extbase:${{ matrix.typo3-version }}" "typo3/cms-frontend:${{ matrix.typo3-version }}" "typo3/cms-fluid-styled-content:${{ matrix.typo3-version }}" | ||
|
||
- name: PHPUnit Tests | ||
run: |- | ||
export typo3DatabaseDriver="pdo_mysql" | ||
export typo3DatabaseName="typo3" | ||
export typo3DatabaseHost="127.0.0.1" | ||
export typo3DatabaseUsername="root" | ||
export typo3DatabasePassword="root" | ||
./vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/composer.lock | ||
/.php-cs-fixer.cache | ||
/.phpunit.cache | ||
/.Build/ | ||
/public/ | ||
/vendor/ | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use TYPO3\CMS\Core\Domain\Repository\PageRepository; | ||
|
||
return [ | ||
'pages' => [ | ||
0 => [ | ||
'uid' => '1', | ||
'pid' => '0', | ||
'title' => 'Root', | ||
'doktype' => PageRepository::DOKTYPE_DEFAULT, | ||
'slug' => '/', | ||
'sorting' => '128', | ||
'deleted' => '0', | ||
'backend_layout' => 'pagets__MainTemplate', | ||
'backend_layout_next_level' => 'pagets__MainTemplate', | ||
], | ||
1 => [ | ||
'uid' => '2', | ||
'pid' => '1', | ||
'title' => 'Root', | ||
'doktype' => PageRepository::DOKTYPE_DEFAULT, | ||
'slug' => '/test', | ||
'sorting' => '128', | ||
'deleted' => '0', | ||
], | ||
], | ||
'sys_file_storage' => [ | ||
0 => [ | ||
'uid' => '1', | ||
'name' => 'test', | ||
'driver' => 'Local', | ||
'is_default' => '1', | ||
'is_public' => '1', | ||
'is_browsable' => '1', | ||
'is_writable' => '1', | ||
'configuration' => '<?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
<T3FlexForms> | ||
<data> | ||
<sheet index="sDEF"> | ||
<language index="lDEF"> | ||
<field index="basePath"> | ||
<value index="vDEF">fileadmin/</value> | ||
</field> | ||
<field index="pathType"> | ||
<value index="vDEF">relative</value> | ||
</field> | ||
<field index="baseUri"> | ||
<value index="vDEF"></value> | ||
</field> | ||
<field index="caseSensitive"> | ||
<value index="vDEF">1</value> | ||
</field> | ||
</language> | ||
</sheet> | ||
</data> | ||
</T3FlexForms>', | ||
], | ||
], | ||
'sys_file' => [ | ||
0 => [ | ||
'uid' => '1', | ||
'pid' => '0', | ||
'storage' => '1', | ||
'type' => '2', | ||
'identifier' => 'test_data/Example.png', | ||
'name' => 'Example.png', | ||
'extension' => 'png', | ||
'mime_type' => 'image/png', | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
base: / | ||
languages: | ||
- | ||
title: English | ||
enabled: true | ||
base: / | ||
typo3Language: default | ||
locale: en_GB.UTF-8 | ||
iso-639-1: en | ||
websiteTitle: '' | ||
navigationTitle: English | ||
hreflang: en-GB | ||
direction: '' | ||
flag: gb | ||
languageId: 0 | ||
fallbackType: strict | ||
fallbacks: '0' | ||
rootPageId: 1 | ||
websiteTitle: 'Container Example' |
23 changes: 23 additions & 0 deletions
23
Tests/Fixtures/container_example/Configuration/TCA/Overrides/tt_content_container_1col.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use B13\Container\Tca\ContainerConfiguration; | ||
use B13\Container\Tca\Registry; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
(static function (string $cType = 'example_container-1col'): void { | ||
GeneralUtility::makeInstance(Registry::class)->configureContainer(new ContainerConfiguration( | ||
$cType, | ||
'1 Column: 100', | ||
'(100%)', | ||
[ | ||
[ | ||
[ | ||
'name' => 'Column 101', | ||
'colPos' => 101, | ||
], | ||
], | ||
] | ||
)); | ||
})(); |
27 changes: 27 additions & 0 deletions
27
...ixtures/container_example/Configuration/TCA/Overrides/tt_content_container_2col_33_66.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use B13\Container\Tca\ContainerConfiguration; | ||
use B13\Container\Tca\Registry; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
(static function (string $cType = 'example_container-2col-33-66'): void { | ||
GeneralUtility::makeInstance(Registry::class)->configureContainer(new ContainerConfiguration( | ||
$cType, | ||
'2 Column: 33-66', | ||
'(33% / 66%)', | ||
[ | ||
[ | ||
[ | ||
'name' => 'Column 101', | ||
'colPos' => 101, | ||
], | ||
[ | ||
'name' => 'Column 102', | ||
'colPos' => 102, | ||
], | ||
], | ||
] | ||
)); | ||
})(); |
27 changes: 27 additions & 0 deletions
27
...ixtures/container_example/Configuration/TCA/Overrides/tt_content_container_2col_50_50.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use B13\Container\Tca\ContainerConfiguration; | ||
use B13\Container\Tca\Registry; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
(static function (string $cType = 'example_container-2col-50-50'): void { | ||
GeneralUtility::makeInstance(Registry::class)->configureContainer(new ContainerConfiguration( | ||
$cType, | ||
'2 Column: 50-50', | ||
'(50% / 50%)', | ||
[ | ||
[ | ||
[ | ||
'name' => 'Column 101', | ||
'colPos' => 101, | ||
], | ||
[ | ||
'name' => 'Column 102', | ||
'colPos' => 102, | ||
], | ||
], | ||
] | ||
)); | ||
})(); |
27 changes: 27 additions & 0 deletions
27
...ixtures/container_example/Configuration/TCA/Overrides/tt_content_container_2col_66_33.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use B13\Container\Tca\ContainerConfiguration; | ||
use B13\Container\Tca\Registry; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
(static function (string $cType = 'example_container-2col-66-33'): void { | ||
GeneralUtility::makeInstance(Registry::class)->configureContainer(new ContainerConfiguration( | ||
$cType, | ||
'2 Column: 66-33', | ||
'(66% / 33%)', | ||
[ | ||
[ | ||
[ | ||
'name' => 'Column 101', | ||
'colPos' => 101, | ||
], | ||
[ | ||
'name' => 'Column 102', | ||
'colPos' => 102, | ||
], | ||
], | ||
] | ||
)); | ||
})(); |
31 changes: 31 additions & 0 deletions
31
Tests/Fixtures/container_example/Configuration/TCA/Overrides/tt_content_container_3col.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use B13\Container\Tca\ContainerConfiguration; | ||
use B13\Container\Tca\Registry; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
|
||
(static function (string $cType = 'example_container-3col'): void { | ||
GeneralUtility::makeInstance(Registry::class)->configureContainer(new ContainerConfiguration( | ||
$cType, | ||
'3 Column: 33-33-33', | ||
'(33% / 33% / 33%)', | ||
[ | ||
[ | ||
[ | ||
'name' => 'Column 101', | ||
'colPos' => 101, | ||
], | ||
[ | ||
'name' => 'Column 102', | ||
'colPos' => 102, | ||
], | ||
[ | ||
'name' => 'Column 103', | ||
'colPos' => 103, | ||
], | ||
], | ||
] | ||
)); | ||
})(); |
22 changes: 22 additions & 0 deletions
22
Tests/Fixtures/container_example/Configuration/TSconfig/Page/Backend_Layouts.tsconfig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
mod.web_layout.BackendLayouts { | ||
MainTemplate { | ||
title = MainTemplate | ||
name = MainTemplate | ||
config { | ||
backend_layout { | ||
colCount = 1 | ||
rowCount = 1 | ||
rows { | ||
1 { | ||
columns { | ||
1 { | ||
name = Main Content | ||
colPos = 0 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
Tests/Fixtures/container_example/Configuration/TypoScript/Container/1col.typoscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
plugin.tx_responsiveimages { | ||
settings { | ||
example_container-1col { | ||
columns { | ||
101 { | ||
multiplier { | ||
xs = 1 | ||
sm = 1 | ||
md = 1 | ||
lg = 1 | ||
xl = 1 | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.