#2737719: EntityResource: Provide comprehensive test coverage: for every entity type, every format, every method added comprehensive test coverage for entities.
We need the same for fields. Because #2751325: All serialized values are strings, should be integers/booleans when appropriate shows that even the most trivial improvement (a small bugfix) is impossible to land. We need more guarantees.
Comments
Comment #3
wim leersComment #4
wim leersI think the situation isn't as bad as I indicated in the issue summary.
Key normalizers like
\Drupal\hal\Normalizer\ContentEntityNormalizerand\Drupal\serialization\Normalizer\EntityNormalizer,\Drupal\serialization\Normalizer\FieldItemNormalizerare abstract. Gazillions of variations are possible. It's impossible to completely unit test those normalizers. Hence the need for comprehensive functional tests, which test them for every possible entity type. That's what #2737719: EntityResource: Provide comprehensive test coverage: for every entity type, every format, every method already did.Concrete field normalizers are getting strict test coverage:
\Drupal\serialization\Normalizer\PrimitiveDataNormalizergot unit test coverage in #2751325: All serialized values are strings, should be integers/booleans when appropriateTimestampItemNormalizeris being added in #2768651: Let TimestampItem (de)normalize to/from RFC3339 timestamps, not UNIX timestamps, for better DX and comes with strict unit test coverage.DateTimeItemNormalizeris being added in #2824717: Add a format constraint to DateTimeItem to provide REST error message and is getting strict test coverage too, unit and even functional (seeEntityTestDatetimeTest+EntityTestDateonlyTest)So, closing this.
Comment #5
wim leers