diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0aef013..f759c31 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e97650..108e787 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/Classes/Command/ConvertFromCsv.php b/Classes/Command/ConvertFromCsv.php index 1220ba2..544ea36 100644 --- a/Classes/Command/ConvertFromCsv.php +++ b/Classes/Command/ConvertFromCsv.php @@ -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 diff --git a/Classes/Command/ConvertFromXml.php b/Classes/Command/ConvertFromXml.php index 4cf2a38..57fb5b7 100644 --- a/Classes/Command/ConvertFromXml.php +++ b/Classes/Command/ConvertFromXml.php @@ -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 diff --git a/Classes/PhpDataSet.php b/Classes/PhpDataSet.php index 795e833..a8ad5cb 100644 --- a/Classes/PhpDataSet.php +++ b/Classes/PhpDataSet.php @@ -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); - $tableDetails = $connection->getSchemaManager()->listTableDetails($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 = []; diff --git a/Classes/TestingFramework.php b/Classes/TestingFramework.php index 5c9e2c6..fc81b83 100644 --- a/Classes/TestingFramework.php +++ b/Classes/TestingFramework.php @@ -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 . '".'; } } diff --git a/composer.json b/composer.json index c1898a0..1c6ecb8 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index bb9e07e..c1dca21 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,33 +1,30 @@ - Tests/Functional/ - + Classes - + diff --git a/shell.nix b/shell.nix index aa6cf9d..01edadd 100644 --- a/shell.nix +++ b/shell.nix @@ -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 {