Skip to content

Commit

Permalink
Merge pull request #196 from eliashaeussler/renovate/major-typo3-cms
Browse files Browse the repository at this point in the history
[TASK] Update typo3/cms-core to v13
  • Loading branch information
eliashaeussler committed Mar 17, 2024
2 parents ccb4426 + 58bd91a commit e83fd77
Show file tree
Hide file tree
Showing 58 changed files with 563 additions and 838 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yaml
Expand Up @@ -16,8 +16,11 @@ jobs:
fail-fast: false
matrix:
php-version: ["8.1", "8.2", "8.3"]
typo3-version: ["11.5", "12.4"]
typo3-version: ["11.5", "12.4", "13.0"]
dependencies: ["highest", "lowest"]
exclude:
- php-version: "8.1"
typo3-version: "13.0"
env:
typo3DatabaseName: typo3
typo3DatabaseHost: '127.0.0.1'
Expand Down
1 change: 0 additions & 1 deletion Classes/Configuration/LowLevelConfigurationProvider.php
Expand Up @@ -39,7 +39,6 @@ final class LowLevelConfigurationProvider implements ConfigurationProvider
{
public function get(string $configPath, mixed $default = null): mixed
{
/* @phpstan-ignore-next-line */
$extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][Extension::KEY] ?? null;

if (!is_array($extensionConfiguration)) {
Expand Down
2 changes: 1 addition & 1 deletion Classes/Formatter/WebStreamFormatter.php
Expand Up @@ -72,7 +72,7 @@ private function filterPendingChoices(array $choices): array
{
return array_filter(
$choices,
static fn(Responses\Chat\CreateResponseChoice $choice): bool => $choice->finishReason === null,
static fn (Responses\Chat\CreateResponseChoice $choice): bool => $choice->finishReason === null,
);
}
}
4 changes: 2 additions & 2 deletions Classes/ProblemSolving/Solution/Solution.php
Expand Up @@ -71,7 +71,7 @@ public static function fromArray(array $solution): self
{
$choices = array_map(
/* @phpstan-ignore-next-line */
static fn(array $choice): Responses\Chat\CreateResponseChoice => Responses\Chat\CreateResponseChoice::from($choice),
static fn (array $choice): Responses\Chat\CreateResponseChoice => Responses\Chat\CreateResponseChoice::from($choice),
$solution['choices'],
);

Expand Down Expand Up @@ -137,7 +137,7 @@ public function toArray(): array
{
return [
'choices' => array_map(
static fn(Responses\Chat\CreateResponseChoice $choice): array => $choice->toArray(),
static fn (Responses\Chat\CreateResponseChoice $choice): array => $choice->toArray(),
$this->choices,
),
'model' => $this->model,
Expand Down
2 changes: 1 addition & 1 deletion Classes/ViewHelpers/MarkdownToHtmlViewHelper.php
Expand Up @@ -90,7 +90,7 @@ private static function replaceLineNumbersInCodeSnippets(string $html): string
'</span><span',
preg_replace_callback(
'/<pre><code>(.*?)<\/code><\/pre>/s',
static fn(array $matches): string => self::replaceLineNumbersInCodeSnippet($matches[1]),
static fn (array $matches): string => self::replaceLineNumbersInCodeSnippet($matches[1]),
$html,
) ?? $html,
) ?? $html;
Expand Down
2 changes: 1 addition & 1 deletion Configuration/Services.php
Expand Up @@ -25,7 +25,7 @@

use Symfony\Component\DependencyInjection;

return static function (
return static function(
DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator,
DependencyInjection\ContainerBuilder $containerBuilder,
): void {
Expand Down
18 changes: 10 additions & 8 deletions Documentation/Installation/Index.rst
Expand Up @@ -12,7 +12,7 @@ Requirements
============

- PHP 8.1 - 8.3
- TYPO3 11.5 LTS - 12.4 LTS
- TYPO3 11.5 LTS - 13.0 LTS

.. _steps:

Expand All @@ -33,10 +33,12 @@ Or download it from the
Version matrix
==============

+--------------------+-------------------------+---------------+
| Extension versions | TYPO3 versions | PHP versions |
+====================+=========================+===============+
| **since 0.2.8** | **11.5 LTS - 12.4 LTS** | **8.1 - 8.3** |
+--------------------+-------------------------+---------------+
| 0.1.0 - 0.2.7 | 11.5 LTS - 12.4 LTS | 8.1 - 8.2 |
+--------------------+-------------------------+---------------+
+--------------------+---------------------+---------------+
| Extension versions | TYPO3 versions | PHP versions |
+====================+=====================+===============+
| **since 0.2.10** | **11.5 LTS - 13.0** | **8.1 - 8.3** |
+--------------------+---------------------+---------------+
| 0.2.8 - 0.2.9 | 11.5 LTS - 12.4 LTS | 8.1 - 8.3 |
+--------------------+---------------------+---------------+
| 0.1.0 - 0.2.7 | 11.5 LTS - 12.4 LTS | 8.1 - 8.2 |
+--------------------+---------------------+---------------+
2 changes: 1 addition & 1 deletion Documentation/Introduction/Index.rst
Expand Up @@ -34,7 +34,7 @@ Features
- Caching integration for solves problems
- Console command to solve problems from command line
- Customizable solution providers and prompts
- Compatible with TYPO3 11.5 LTS and 12.4 LTS
- Compatible with TYPO3 11.5 LTS, 12.4 LTS and 13.0

.. _support:

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -26,7 +26,7 @@ provides a console command to solve problems from command line.
* Caching integration for solved problems
* Command to solve problems from command line
* Customizable solution providers and prompts
* Compatible with TYPO3 11.5 LTS and 12.4 LTS
* Compatible with TYPO3 11.5 LTS, 12.4 LTS and 13.0

## 🔥 Installation

Expand Down
Expand Up @@ -21,22 +21,32 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

namespace EliasHaeussler\Typo3Solver\Tests\Hooks;
namespace EliasHaeussler\Typo3Solver\Tests\Extension;

use EliasHaeussler\Typo3Solver as Src;
use PHPUnit\Event;
use PHPUnit\Runner;
use PHPUnit\TextUI;

/**
* ExtensionConfigurationHook
* ExtensionConfigurationExtension
*
* @author Elias Häußler <elias@haeussler.dev>
* @license GPL-2.0-or-later
* @internal
*/
final class ExtensionConfigurationHook implements Runner\BeforeTestHook
final class ExtensionConfigurationExtension implements Runner\Extension\Extension, Event\Test\BeforeTestMethodCalledSubscriber
{
public function executeBeforeTest(string $test): void
public function bootstrap(
TextUI\Configuration\Configuration $configuration,
Runner\Extension\Facade $facade,
Runner\Extension\ParameterCollection $parameters,
): void {
$facade->registerSubscriber($this);
}

public function notify(Event\Test\BeforeTestMethodCalled $event): void
{
/* @phpstan-ignore-next-line */
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS'][Src\Extension::KEY] = [
'api' => [
'key' => 'foo',
Expand Down
Expand Up @@ -21,7 +21,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

return (static function () {
return (static function() {
$middlewares = require dirname(__DIR__, 6) . '/Configuration/RequestMiddlewares.php';

foreach ($middlewares as &$contextMiddlewares) {
Expand Down
Expand Up @@ -23,6 +23,6 @@

use Symfony\Component\DependencyInjection;

return static function (DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator): void {
return static function(DependencyInjection\Loader\Configurator\ContainerConfigurator $containerConfigurator): void {
$containerConfigurator->import('../../../../../../Configuration/Services.php');
};
9 changes: 3 additions & 6 deletions Tests/Functional/Middleware/PingMiddlewareTest.php
Expand Up @@ -24,6 +24,7 @@
namespace EliasHaeussler\Typo3Solver\Tests\Functional\Middleware;

use EliasHaeussler\Typo3Solver\Tests;
use PHPUnit\Framework;
use TYPO3\TestingFramework;

/**
Expand All @@ -42,9 +43,7 @@ final class PingMiddlewareTest extends TestingFramework\Core\Functional\Function

protected bool $initializeDatabase = false;

/**
* @test
*/
#[Framework\Attributes\Test]
public function middlewareIsSkippedOnUnsupportedRequest(): void
{
$request = self::createRequest('/tx_solver/ping')->withoutHeader('Accept');
Expand All @@ -53,9 +52,7 @@ public function middlewareIsSkippedOnUnsupportedRequest(): void
self::assertNotSame(200, $response->getStatusCode());
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function middlewareIsSkippedOnNonMatchingRoute(): void
{
$request = self::createRequest('/');
Expand Down
9 changes: 3 additions & 6 deletions Tests/Functional/Middleware/SolutionMiddlewareTest.php
Expand Up @@ -24,6 +24,7 @@
namespace EliasHaeussler\Typo3Solver\Tests\Functional\Middleware;

use EliasHaeussler\Typo3Solver\Tests;
use PHPUnit\Framework;
use TYPO3\TestingFramework;

/**
Expand All @@ -42,9 +43,7 @@ final class SolutionMiddlewareTest extends TestingFramework\Core\Functional\Func

protected bool $initializeDatabase = false;

/**
* @test
*/
#[Framework\Attributes\Test]
public function middlewareIsSkippedOnUnsupportedRequest(): void
{
$request = self::createRequest('/tx_solver/solution')->withoutHeader('Accept');
Expand All @@ -53,9 +52,7 @@ public function middlewareIsSkippedOnUnsupportedRequest(): void
self::assertNotSame(200, $response->getStatusCode());
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function middlewareIsSkippedOnNonMatchingRoute(): void
{
$request = self::createRequest('/');
Expand Down
11 changes: 5 additions & 6 deletions Tests/Functional/ViewHelpers/DateViewHelperTest.php
Expand Up @@ -27,6 +27,7 @@
use DateTimeInterface;
use EliasHaeussler\Typo3Solver\Tests;
use Generator;
use PHPUnit\Framework;
use TYPO3\TestingFramework;

use function trim;
Expand All @@ -47,9 +48,7 @@ final class DateViewHelperTest extends TestingFramework\Core\Functional\Function

protected bool $initializeDatabase = false;

/**
* @test
*/
#[Framework\Attributes\Test]
public function renderStaticReturnsNonReadableFormattedDate(): void
{
$date = new DateTimeImmutable();
Expand All @@ -64,10 +63,10 @@ public function renderStaticReturnsNonReadableFormattedDate(): void
}

/**
* @test
* @dataProvider renderStaticReturnsHumanReadableDateDataProvider
* @param non-empty-string $expected
*/
#[Framework\Attributes\Test]
#[Framework\Attributes\DataProvider('renderStaticReturnsHumanReadableDateDataProvider')]
public function renderStaticReturnsHumanReadableDate(DateTimeInterface $date, string $expected): void
{
$view = $this->createView('<s:date date="{date}" readable="1" />');
Expand All @@ -81,7 +80,7 @@ public function renderStaticReturnsHumanReadableDate(DateTimeInterface $date, st
*/
public static function renderStaticReturnsHumanReadableDateDataProvider(): Generator
{
$format = static fn(int $interval, string $unit): array => [
$format = static fn (int $interval, string $unit): array => [
new DateTimeImmutable($interval . ' ' . $unit . ' ago'),
$unit . ' ago',
];
Expand Down
13 changes: 4 additions & 9 deletions Tests/Functional/ViewHelpers/MarkdownToHtmlViewHelperTest.php
Expand Up @@ -25,6 +25,7 @@

use EliasHaeussler\Typo3Solver\Tests;
use Parsedown;
use PHPUnit\Framework;
use TYPO3\TestingFramework;

use function trim;
Expand Down Expand Up @@ -55,9 +56,7 @@ protected function setUp(): void
$this->parsedown = new Parsedown();
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function renderStaticConvertsMarkdownToHtml(): void
{
$markdown = <<<'MARKDOWN'
Expand All @@ -75,9 +74,7 @@ public function renderStaticConvertsMarkdownToHtml(): void
);
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function renderStaticCanBeUsedWithContentArgument(): void
{
$markdown = <<<'MARKDOWN'
Expand All @@ -95,9 +92,7 @@ public function renderStaticCanBeUsedWithContentArgument(): void
);
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function renderStaticReplacesLinNumbersInCodeSnippets(): void
{
$markdown = <<<'MARKDOWN'
Expand Down
21 changes: 6 additions & 15 deletions Tests/Unit/Authentication/StreamAuthenticationTest.php
Expand Up @@ -24,6 +24,7 @@
namespace EliasHaeussler\Typo3Solver\Tests\Unit\Authentication;

use EliasHaeussler\Typo3Solver as Src;
use PHPUnit\Framework;
use Symfony\Component\Filesystem;
use TYPO3\TestingFramework;

Expand Down Expand Up @@ -52,9 +53,7 @@ protected function setUp(): void
$this->subject = new Src\Authentication\StreamAuthentication();
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function constructorCreatesTransientFileIfNotExists(): void
{
$this->filesystem->remove($this->filename);
Expand All @@ -67,9 +66,7 @@ public function constructorCreatesTransientFileIfNotExists(): void
self::assertSame('', file_get_contents($this->filename));
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function authenticateThrowsExceptionIfFileCannotBeRead(): void
{
$this->filesystem->remove($this->filename);
Expand All @@ -81,9 +78,7 @@ public function authenticateThrowsExceptionIfFileCannotBeRead(): void
$this->subject->authenticate('foo');
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function authenticateThrowsExceptionIfHashIsNotRegistered(): void
{
$this->expectExceptionObject(
Expand All @@ -93,9 +88,7 @@ public function authenticateThrowsExceptionIfHashIsNotRegistered(): void
$this->subject->authenticate('foo');
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function authenticateRemovesHashFromTransientFileOnSuccessfulAuthentication(): void
{
$registeredHash = $this->subject->register();
Expand All @@ -112,9 +105,7 @@ public function authenticateRemovesHashFromTransientFileOnSuccessfulAuthenticati
self::assertNotContains($registeredHash, $registeredHashesAfterAuthentication);
}

/**
* @test
*/
#[Framework\Attributes\Test]
public function registerWritesHashToTransientFile(): void
{
$actual = $this->subject->register();
Expand Down

0 comments on commit e83fd77

Please sign in to comment.