Review 13.4 Merged

87362[TASK] Provide more tests for DataMapFactory

Garvin Hicking CR +2 V +2 Hard +303 −33 updated 12/04/24, 17:26

Commit message

With #105754 it became apparent that test coverage is
lacking for the DataMapFactory to provide column name mapping
for 'ctrl' fields.

The actual "proof" of previously wrong mapped data is now
covered in
`DataMapFactoryTest::customRestrictionFieldsAreMappedWithProperDataMap`.

It checks a newly introduced `blog_example` extension fixture domain
model `RestrictedComment` that uses all existing customizable 'ctrl'
field column names and ensures the data is passed along properly.

When patch #105754 would be reverted, for example via:

```
--- a/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php
+++ b/typo3/sysext/extbase/Classes/Persistence/Generic/Mapper/DataMapFactory.php
@@ -139,8 +139,8 @@ readonly class DataMapFactory
             deletedFlagColumnName: $schema?->hasCapability(TcaSchemaCapability::SoftDelete)
                 ? (string)$schema->getCapability(TcaSchemaCapability::SoftDelete)
                 : null,
-            disabledFlagColumnName: $schema?->hasCapability(TcaSchemaCapability::RestrictionDisabledField)
-                ? (string)$schema->getCapability(TcaSchemaCapability::RestrictionDisabledField)
+            disabledFlagColumnName: $schema?->hasCapability(TcaSchemaCapability::RestrictionStartTime)
+                ? (string)$schema->getCapability(TcaSchemaCapability::RestrictionStartTime)
                 : null,
             startTimeColumnName: $schema?->hasCapability(TcaSchemaCapability::RestrictionStartTime)
                 ? (string)$schema->getCapability(TcaSchemaCapability::RestrictionStartTime)
```

this test would then fail.

Also, tests are added to the `DataMapperTest` to create and verify
extbase domain models with customized 'ctrl' column field names
can be persisted and retrieved.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2
    • core-ci +1 CI

Issues 3

Files 7

Review log 58

  1. Garvin Hicking commented on patch set 1 12/04/24, 16:41

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V -1 12/04/24, 16:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70600

  3. Garvin Hicking uploaded patch set 2 12/04/24, 16:56

    Fix Test Copied Votes: * Verified-1 (copy condition: "**changekind:NO_CHANGE**")
  4. core-ci voted on patch set 2 V -1 12/04/24, 17:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70601

  5. Garvin Hicking uploaded patch set 3 V -1 12/04/24, 17:06

    For real now
  6. core-ci voted on patch set 3 V +1 12/04/24, 17:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/70602

  7. Garvin Hicking voted on patch set 3 CR +2 V +2 12/04/24, 17:25

  8. Garvin Hicking merged patch set 4 12/04/24, 17:26