Issue Task Resolved

#110257Clean up unit test mock platforms for Doctrine DBAL

Stefan Bürk 07/21/26, 19:46 updated 07/24/26, 09:50

Description

The unit test mock platforms below `core/Tests/Unit/Database/Mocks/` carry
leftovers from Doctrine DBAL 3:

1) `getReservedKeywordsClass()`

All five mock platforms override this method, returning `MockKeywordList`.
Doctrine DBAL 4 replaced it with the abstract `createReservedKeywordsList()`,
which returns a `KeywordList` instance instead of a class name. The method no
longer exists in `AbstractPlatform`, so the five overrides are dead code and
`MockKeywordList` is unused – `MockPlatform` already implements
`createReservedKeywordsList()` with an anonymous class.
The overrides and `MockKeywordList` are removed. Note that
`createReservedKeywordsList()` is `abstract protected` in Doctrine DBAL 4.4
and has to stay.

2) Missing unquoted identifier folding

Doctrine DBAL 4.4 deprecated constructing an `AbstractPlatform` without
passing `$unquotedIdentifierFolding` [1], and the deprecation triggers at
runtime. Verified by instantiating all five mocks with deprecation tracking
enabled: only `MockPlatform` triggers it, because it extends
`AbstractPlatform` directly. The other four extend concrete TYPO3 platforms,
whose Doctrine parents already pass the value.
`MockPlatform` gets an explicit constructor passing
`UnquotedIdentifierFolding::UPPER` – the standard SQL behaviour and exactly
the value Doctrine falls back to when the argument is omitted, so nothing
changes but the deprecation. The parameter stays optional, so the existing
instantiations keep working.

Test fixtures only, no production code involved.

[1] https://github.com/doctrine/dbal/pull/6823

Reviews 3