Skip to content

netresearch/typo3-testing-skill / skills/typo3-testing

typo3-testing

Flagged

Use when reproducing defects as failing tests, testing template or rendered output changes, confirming changes on a running TYPO3 instance, or setting up TYPO3 extension tests: unit/functional/E2E, PHPUnit 11-13, mutation testing, final-class mocks (v14), CI matrix across TYPO3 12/13/14.3 LTS, typo3-ci-workflows meta-package, CI failures. Also: transaction rollback, worker crashes, competing requests, testing-framework setup, test matrix, integration/e2e testing, coverage, test generation.

FileKindSize
SKILL.mdskill md6.8 KB
assets/.php-cs-fixer.dist.phpscript7.0 KB
assets/AGENTS.mdmarkdown5.0 KB
assets/Build/Scripts/runTests.shexecutablescript27.5 KB
assets/Build/playwright/.nvmrcother6 B
assets/Build/playwright/package.jsonmanifest535 B
assets/Build/playwright/playwright.config.tsscript1.3 KB
assets/Build/playwright/tests/playwright/accessibility/modules.spec.tsscript2.0 KB
assets/Build/playwright/tests/playwright/config.tsscript712 B
assets/Build/playwright/tests/playwright/e2e/backend-module.spec.tsscript1.9 KB
assets/Build/playwright/tests/playwright/fixtures/setup-fixtures.tsscript2.7 KB
assets/Build/playwright/tests/playwright/helper/login.setup.tsscript975 B
assets/FunctionalTests.xmlconfig1.4 KB
assets/FunctionalTestsBootstrap.phpscript1.6 KB
assets/Makefileother2.3 KB
assets/UnitTests.xmlconfig890 B
assets/UnitTestsBootstrap.phpscript2.1 KB
assets/bootstrap.phpscript1.4 KB
assets/codecov.ymlconfig1.6 KB
assets/docker/codeception.ymlconfig979 B
assets/docker/docker-compose.ymlconfig1.4 KB
assets/example-tests/ExampleAcceptanceCest.phpscript2.2 KB
assets/example-tests/ExampleFunctionalTest.phpscript2.4 KB
assets/example-tests/ExampleUnitTest.phpscript1.6 KB
assets/fixtures/README.mdmarkdown2.0 KB
assets/fixtures/be_users.csvother361 B
assets/fixtures/pages.csvother257 B
assets/fixtures/sys_category.csvother228 B
assets/fixtures/tt_content.csvother338 B
assets/github-actions-e2e.ymlconfig8.8 KB
assets/github-actions-tests.ymlconfig6.3 KB
assets/infection.json5other2.8 KB
assets/phpat.neonother330 B
assets/phpat.phpscript8.4 KB
assets/phpstan-baseline.neonother365 B
assets/phpstan.neonother1.4 KB
assets/rector.phpscript2.9 KB
checkpoints.yamlconfig61.7 KB
references/accessibility-testing.mdmarkdown7.6 KB
references/architecture-testing.mdmarkdown4.4 KB
references/asset-templates-guide.mdmarkdown3.4 KB
references/backend-module-render-verification.mdmarkdown9.7 KB
references/backend-user-access-testing.mdmarkdown9.5 KB
references/captainhook-setup.mdmarkdown2.4 KB
references/ci-cd.mdmarkdown39.5 KB
references/ci-debugging.mdmarkdown20.0 KB
references/ci-workflows-meta-package.mdmarkdown11.6 KB
references/crash-and-concurrency-testing.mdmarkdown4.8 KB
references/crypto-testing.mdmarkdown16.6 KB
references/datahandler-silent-rewrites.mdmarkdown7.2 KB
references/ddev-testing.mdmarkdown1.3 KB
references/e2e-testing.mdmarkdown53.0 KB
references/enforcement-rules.mdmarkdown5.7 KB
references/event-dispatch-testing.mdmarkdown2.8 KB
references/framework-compat-gate.mdmarkdown4.9 KB
references/functional-test-patterns.mdmarkdown11.0 KB
references/functional-testing.mdmarkdown46.3 KB
references/fuzz-testing.mdmarkdown8.6 KB
references/integration-testing.mdmarkdown14.1 KB
references/javascript-testing.mdmarkdown29.3 KB
references/live-instance-verification.mdmarkdown8.6 KB
references/mock-validity.mdmarkdown15.7 KB
references/mutation-testing.mdmarkdown36.0 KB
references/performance-testing.mdmarkdown11.2 KB
references/quality-tools.mdmarkdown25.5 KB
references/release-workflow-validation.mdmarkdown3.6 KB
references/sonarcloud.mdmarkdown18.8 KB
references/synthetic-secret-fixtures.mdmarkdown3.8 KB
references/tdd-discipline.mdmarkdown9.1 KB
references/test-environment-guards.mdmarkdown18.5 KB
references/test-runners.mdmarkdown24.6 KB
references/typo3-ci-config-patterns.mdmarkdown9.0 KB
references/typo3-v14-final-classes.mdmarkdown16.5 KB
references/unit-testing.mdmarkdown59.1 KB
scripts/generate-test.shexecutablescript6.0 KB
scripts/setup-testing.shexecutablescript6.3 KB
scripts/validate-setup.shexecutablescript4.0 KB

references/datahandler-silent-rewrites.md

View on GitHub
<!-- SPDX-License-Identifier: CC-BY-SA-4.0 -->
<!-- SPDX-FileCopyrightText: Netresearch DTT GmbH -->

# What the DataHandler does not enforce, and what it rewrites in silence

> **Source**: netresearch/t3x-nr-llm [PR 957](https://github.com/netresearch/t3x-nr-llm/pull/957) and [PR 958](https://github.com/netresearch/t3x-nr-llm/pull/958) — agent tools that create records through the DataHandler (2026-09). Line numbers: cms-core / cms-backend 14.3.7 unless stated.

For anyone testing code that writes through `DataHandler` without FormEngine in front of it: agent tools, importers, API endpoints, CLI commands. `process_datamap()` reports no error for any row below. A test that only asserts "no error log entry" or "a uid came back" passes while the stored record differs from the request. Each row names what to assert instead.

## Rules only FormEngine applies

| Behaviour | Core location | Test that pins it |
|---|---|---|
| Page TSconfig `TCEFORM.<table>.<col>.keepItems` / `removeItems` / `disabled` / `config.readOnly` / `label` are applied by the backend form only. The DataHandler stores a removed item, a disabled column or a read-only column anyway. | cms-backend `AbstractItemProvider::removeItemsByKeepItemsPageTsConfig()` / `removeItemsByRemoveItemsPageTsConfig()`; `SingleFieldContainer` (`disabled`, any truthy value, line 87); `FormEngineUtility::$allowOverrideMatrix` (`config.*`); `TcaColumnsProcessFieldLabels` (`label`) | Pre-check: resolve the page's TSconfig for the target pid and refuse the value the form would not offer. One data-provider row per rule, each asserting the refusal names the rule. |
| `TCEFORM.<table>.<col>.types.<type>.` overrides are merged over the column rule for that record type. | cms-backend `PageTsConfigMerged` lines 50-52 | Same pre-check with the record type resolved first; one case where only the type rule forbids the value. |
| `keepItems` / `removeItems` exist for select-like fields only (select, language, category, country, select tree), not for `radio` or `check`. `config.readOnly` applies only to types that list it in `$allowOverrideMatrix`; `radio` has no entry there. | `TcaSelectItems`, `TcaLanguage`, `TcaCategory`, `TcaCountry`, `TcaSelectTreeItems` call the two methods; `$allowOverrideMatrix` lines 50-69 | A radio column with `removeItems` set is **not** refused — pin the negative case too, or the pre-check over-refuses. |

## Values dropped without a word

| Behaviour | Core location | Test that pins it |
|---|---|---|
| A column with `exclude` set is skipped unless the user holds `non_exclude_fields` for `<table>:<col>`. `exclude` is truthy (`(bool)`), not `=== true`: `'1'` and `1` count. | `DataHandler::fillInFieldArray()` line 1121 → `AbstractFieldType::supportsAccessControl()` lines 56-59 | Non-admin without the grant writes the column → read-back shows the default; with the grant → the value. |
| A `select` value failing `authMode` is removed; if every value fails, the column is not written. Applies to every select with `authMode`, not only `CType`. | `DataHandler::checkValueForGroupFolderSelect()` lines 2259-2269 | Editor without `explicit_allowdeny` for the value → read-back shows the default. |
| `eval=md5` drops a value that is not 32 characters (the column is not written). | `checkValue_input_Eval()` lines 2821-2825 | Write 31 characters → read-back unchanged. |
| input `min`: a shorter value is replaced by `''`. text `min`: the same, unless the column is RTE. | `checkValueForInput()` lines 1495-1499; `checkValueForText()` lines 1444-1448 | Write `min - 1` characters → read-back `''`. |

## Values rewritten on store

| Behaviour | Core location | Test that pins it |
|---|---|---|
| `number` with `format=decimal` is stored as `number_format($value, 2)`. The `range` check runs on that rounded value with `ceil()` / `floor()` and clamps to the bound, stored as a float (`10.0`, not `'10.00'`). | `checkValueForNumber()` lines 1542-1578 | Write `1.239` → `'1.24'`; write above `upper` → the bound. Compare numerically. |
| input `max` truncates (`mb_substr`). | `checkValueForInput()` lines 1491-1493 | Write `max + 1` characters → read-back is cut. |
| Transforming `eval` tokens: `trim`, `upper`, `lower`, `nospace`, `alpha`, `num`, `alphanum`, `alphanum_x`, `is_in`, `domainname` (IDN → punycode) and any registered `formevals` class. `unique` / `uniqueInPid` append a suffix. Unknown tokens are ignored. `year` is cast to int on 13.4 (13.4.21 line 2834) but is no longer a token on 14.3. | `checkValue_input_Eval()` lines 2815-2883; `checkValueForInput()` lines 1511-1518 (`getUnique()`) | One case per token the target table uses; for `unique`, a second record with the same value reads back changed. |
| `color` with an alpha pair (`#rrggbbaa`) is cut to 7 characters unless `opacity` is set. | `checkValueForColor()` lines 1596-1597 | Write `#11223344` → `#112233`. |
| RTE columns pass through `RteHtmlParser::transformTextForPersistence()`, which re-joins blocks with `LF`. | `checkValueForText()` lines 1467-1472; `RteHtmlParser` (`implode(LF, …)`) | Compare by presence of the expected text/tags, not byte equality. |

## Defaults and record types

| Behaviour | Core location | Test that pins it |
|---|---|---|
| `TCAdefaults` for a new record: user TSconfig is loaded first, then page TSconfig of the target pid is merged over it (`array_merge`), and both win over the TCA `default`. | `DataHandler::setDefaultsFromUserTS()` lines 541-561, `applyDefaultsForFieldArray()` lines 609-614, `newFieldArray()` line 8240 | Page and user TSconfig set different defaults → read-back shows the page value. |
| A type value with no `types` entry is read as type `'0'` (or `'1'` when `'0'` does not exist), never as the type column's TCA `default`. | cms-backend `BackendUtility::getTCAtypeValue()` lines 723-730 | Write an undeclared type (or let `TCAdefaults` supply one) → assert which `showitem` / `columnsOverrides` applied. |
| Core plugins `indexed_search` (14.3.7), `felogin` and `form` (checked on 14.3.2) register in the `forms` item group, not `plugins`. `indexed_search`'s `pi2` passes no FlexForm, so its CType gets a copy of `types['header']`. | `ExtensionUtility::registerPlugin(…, 'forms', …)` in each `Configuration/TCA/Overrides/tt_content.php`; `ExtensionManagementUtility::addPlugin()` | A "plugins only" filter by item group misses them; assert on the CType list you expect, not on the group. |

## The read-back pattern

After `process_datamap()`, re-read every column the code wrote, plus `pid`, `hidden`, the language column and the record-type column, and compare with the request (numerically for decimals, by presence for RTE). When a column differs, delete the new record through the DataHandler (`cmd` `delete`) and report the column; if that delete fails, say so — the record may be reachable. Name two causes in the message: a missing grant (`non_exclude_fields`, `authMode`) **and** "rewritten by TYPO3" (eval, `max`, `min`, decimals, colour). A message that names only permissions sends the user to the wrong setting.

Pin the pattern with a DataHandler hook fixture that rewrites one column (`processDatamap_postProcessFieldArray`), and assert the record is gone and the column is named.

See also `backend-user-access-testing.md` for making a non-admin editor genuinely pass the page checks first.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall