Add support for TYPO3 v13 and PHP 8.3 (#13)

This commit is contained in:
Daniel Siepmann 2024-02-05 15:51:10 +01:00 committed by GitHub
parent 77a7d13c70
commit ec7e3a8cb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 70 additions and 21 deletions

View file

@ -15,7 +15,7 @@ jobs:
- name: Install PHP - name: Install PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: 8.2 php-version: '8.3'
coverage: none coverage: none
tools: composer:v2 tools: composer:v2
env: env:
@ -35,6 +35,7 @@ jobs:
- 8.0 - 8.0
- 8.1 - 8.1
- 8.2 - 8.2
- 8.3
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
@ -58,7 +59,7 @@ jobs:
- name: Install PHP - name: Install PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: "8.2" php-version: "8.3"
coverage: none coverage: none
tools: composer:v2 tools: composer:v2
env: env:
@ -81,7 +82,7 @@ jobs:
- name: Install PHP - name: Install PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
with: with:
php-version: "8.1" php-version: "8.3"
coverage: none coverage: none
tools: composer:v2 tools: composer:v2
env: env:
@ -121,12 +122,24 @@ jobs:
- db-version: '8' - db-version: '8'
php-version: '8.2' php-version: '8.2'
typo3-version: '^11.5' typo3-version: '^11.5'
- db-version: '8'
php-version: '8.3'
typo3-version: '^11.5'
- db-version: '8' - db-version: '8'
php-version: '8.1' php-version: '8.1'
typo3-version: '^12.4' typo3-version: '^12.4'
- db-version: '8' - db-version: '8'
php-version: '8.2' php-version: '8.2'
typo3-version: '^12.4' typo3-version: '^12.4'
- db-version: '8'
php-version: '8.3'
typo3-version: '^12.4'
- db-version: '8'
php-version: '8.2'
typo3-version: '^13.0'
- db-version: '8'
php-version: '8.3'
typo3-version: '^13.0'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -183,10 +196,18 @@ jobs:
typo3-version: '^11.5' typo3-version: '^11.5'
- php-version: '8.2' - php-version: '8.2'
typo3-version: '^11.5' typo3-version: '^11.5'
- php-version: '8.3'
typo3-version: '^11.5'
- php-version: '8.1' - php-version: '8.1'
typo3-version: '^12.4' typo3-version: '^12.4'
- php-version: '8.2' - php-version: '8.2'
typo3-version: '^12.4' typo3-version: '^12.4'
- php-version: '8.3'
typo3-version: '^12.4'
- php-version: '8.2'
typo3-version: '^13.0'
- php-version: '8.3'
typo3-version: '^13.0'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View file

@ -1,5 +1,12 @@
# Changelog # Changelog
## v1.5.0 - 2024-02-05
### Added
- Support for TYPO3 v13.0.
- Support for PHP 8.3.
## v1.4.1 - 2023-11-09 ## v1.4.1 - 2023-11-09
### Added ### Added

View file

@ -31,7 +31,14 @@ use Symfony\Component\Console\Output\OutputInterface;
class ConvertFromCsv extends Command class ConvertFromCsv extends Command
{ {
/**
* @var string
*/
protected static $defaultName = 'convert-from-csv'; protected static $defaultName = 'convert-from-csv';
/**
* @var string
*/
protected static $defaultDescription = 'Converts CSV data-sets to PHP data-sets.'; protected static $defaultDescription = 'Converts CSV data-sets to PHP data-sets.';
protected function configure(): void protected function configure(): void

View file

@ -31,7 +31,14 @@ use Symfony\Component\Console\Output\OutputInterface;
class ConvertFromXml extends Command class ConvertFromXml extends Command
{ {
/**
* @var string
*/
protected static $defaultName = 'convert-from-xml'; protected static $defaultName = 'convert-from-xml';
/**
* @var string
*/
protected static $defaultDescription = 'Converts XML data-sets to PHP data-sets.'; protected static $defaultDescription = 'Converts XML data-sets to PHP data-sets.';
protected function configure(): void protected function configure(): void

View file

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace Codappix\Typo3PhpDatasets; namespace Codappix\Typo3PhpDatasets;
use RuntimeException;
use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
@ -32,7 +33,16 @@ class PhpDataSet
{ {
foreach ($dataSet as $tableName => $records) { foreach ($dataSet as $tableName => $records) {
$connection = $this->getConnectionPool()->getConnectionForTable($tableName); $connection = $this->getConnectionPool()->getConnectionForTable($tableName);
if (method_exists($connection, 'getSchemaManager')) {
// <= 12
$tableDetails = $connection->getSchemaManager()->listTableDetails($tableName); $tableDetails = $connection->getSchemaManager()->listTableDetails($tableName);
} elseif (method_exists($connection, 'getSchemaInformation')) {
// >= 13
$tableDetails = $connection->getSchemaInformation()->introspectTable($tableName);
} else {
throw new RuntimeException('Could not check the schema for table: ' . $tableName, 1707144020);
}
foreach ($records as $record) { foreach ($records as $record) {
$types = []; $types = [];

View file

@ -84,7 +84,7 @@ trait TestingFramework
if (!empty($records)) { if (!empty($records)) {
foreach ($records as $record) { foreach ($records as $record) {
$recordIdentifier = $tableName . ':' . $record['uid']; $recordIdentifier = $tableName . ':' . ($record['uid'] ?? '');
$failMessages[] = 'Not asserted record found for "' . $recordIdentifier . '".'; $failMessages[] = 'Not asserted record found for "' . $recordIdentifier . '".';
} }
} }

View file

@ -27,18 +27,18 @@
"bin/typo3-php-datasets" "bin/typo3-php-datasets"
], ],
"require": { "require": {
"php": "^7.2 || ^7.3 || ^7.4 || ^8.0 || ^8.1 || ^8.2", "php": "^7.2 || ^7.3 || ^7.4 || ^8.0 || ^8.1 || ^8.2 || ^8.3",
"composer-runtime-api": "^2.2", "composer-runtime-api": "^2.2",
"doctrine/dbal": "^2.13 || ^3.6", "doctrine/dbal": "^2.13 || ^3.6 || ^4.0 || 4.0.0-RC2",
"symfony/console": "^5.4 || ^6.2", "symfony/console": "^5.4 || ^6.2 || ^7.0",
"typo3/cms-core": "^10.4 || ^11.5 || ^12.4" "typo3/cms-core": "^10.4 || ^11.5 || ^12.4 || ^13.0"
}, },
"require-dev": { "require-dev": {
"friendsofphp/php-cs-fixer": "^3.4", "friendsofphp/php-cs-fixer": "^3.4",
"phpstan/phpstan": "^1.10", "phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3", "phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^8.5 || ^9.6", "phpunit/phpunit": "^8.5 || ^9.6 || ^10.0",
"typo3/testing-framework": "^6.16 || ^7.0" "typo3/testing-framework": "^6.16 || ^7.0 || ^8.0"
}, },
"extra": { "extra": {
"typo3/cms": { "typo3/cms": {

View file

@ -1,33 +1,30 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<phpunit <phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
backupGlobals="false" backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php" bootstrap="vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
colors="true" colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false" processIsolation="false"
stopOnError="false" stopOnError="false"
stopOnFailure="false" stopOnFailure="false"
stopOnIncomplete="false" stopOnIncomplete="false"
stopOnSkipped="false" stopOnSkipped="false"
verbose="false" cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
requireCoverageMetadata="false"
> >
<testsuites> <testsuites>
<testsuite name="functional"> <testsuite name="functional">
<directory>Tests/Functional/</directory> <directory>Tests/Functional/</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<coverage> <source>
<include> <include>
<directory suffix=".php">Classes</directory> <directory suffix=".php">Classes</directory>
</include> </include>
</coverage> </source>
<php> <php>
<env name="typo3DatabaseDriver" value="pdo_sqlite"/> <env name="typo3DatabaseDriver" value="pdo_sqlite"/>

View file

@ -4,7 +4,7 @@
}: }:
let let
php = phps.packages.x86_64-linux.php81; php = phps.packages.x86_64-linux.php83;
inherit(php.packages) composer; inherit(php.packages) composer;
phpWithXdebug = php.buildEnv { phpWithXdebug = php.buildEnv {