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

View file

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

View file

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

View file

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

View file

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace Codappix\Typo3PhpDatasets;
use RuntimeException;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Utility\GeneralUtility;
@ -32,7 +33,16 @@ class PhpDataSet
{
foreach ($dataSet as $tableName => $records) {
$connection = $this->getConnectionPool()->getConnectionForTable($tableName);
if (method_exists($connection, 'getSchemaManager')) {
// <= 12
$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) {
$types = [];

View file

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

View file

@ -27,18 +27,18 @@
"bin/typo3-php-datasets"
],
"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",
"doctrine/dbal": "^2.13 || ^3.6",
"symfony/console": "^5.4 || ^6.2",
"typo3/cms-core": "^10.4 || ^11.5 || ^12.4"
"doctrine/dbal": "^2.13 || ^3.6 || ^4.0 || 4.0.0-RC2",
"symfony/console": "^5.4 || ^6.2 || ^7.0",
"typo3/cms-core": "^10.4 || ^11.5 || ^12.4 || ^13.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.4",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-phpunit": "^1.3",
"phpunit/phpunit": "^8.5 || ^9.6",
"typo3/testing-framework": "^6.16 || ^7.0"
"phpunit/phpunit": "^8.5 || ^9.6 || ^10.0",
"typo3/testing-framework": "^6.16 || ^7.0 || ^8.0"
},
"extra": {
"typo3/cms": {

View file

@ -1,33 +1,30 @@
<?xml version="1.0"?>
<phpunit
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"
backupStaticAttributes="false"
bootstrap="vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTestsBootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertWarningsToExceptions="true"
forceCoversAnnotation="false"
processIsolation="false"
stopOnError="false"
stopOnFailure="false"
stopOnIncomplete="false"
stopOnSkipped="false"
verbose="false"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
requireCoverageMetadata="false"
>
<testsuites>
<testsuite name="functional">
<directory>Tests/Functional/</directory>
</testsuite>
</testsuites>
<coverage>
<source>
<include>
<directory suffix=".php">Classes</directory>
</include>
</coverage>
</source>
<php>
<env name="typo3DatabaseDriver" value="pdo_sqlite"/>

View file

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