Per #2931785: The path for JSON API to core:

  1. TODO (test that custom modules' format-agnostic field type normalizers ARE NOT picked up)
  2. TODO (test that custom modules' format-agnostic data type normalizers ARE picked up)

Perhaps unsurprisingly, it turns out that it's probably best that we test both in a single test, much of the infrastructure they need is shared.

Comments

Wim Leers created an issue. See original summary.

wim leers’s picture

Status: Active » Needs review
StatusFileSize
new5.98 KB

Let's kick this off with test coverage for @FieldType-level normalizers.

wim leers’s picture

StatusFileSize
new4.64 KB
new10.07 KB

Let's add @DataType-level normalizer test coverage.

wim leers’s picture

StatusFileSize
new6.67 KB
new10.05 KB

Let's make this more robust, and easier to scan+understand.

wim leers’s picture

StatusFileSize
new5.2 KB
new9.35 KB

Much of the assertions are the same. Let's use a @dataProvider to make this 10x easier to understand and maintain. This now makes the expected differences super obvious!

The last submitted patch, 3: 2950486-3.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

The last submitted patch, 2: 2950486-2.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

wim leers’s picture

Assigned: wim leers » Unassigned
StatusFileSize
new3.52 KB
new9.57 KB

Haha, #2 and #3 would also have passed, if it weren't for the fact that in my rebasing, I accidentally moved some things from later commits into earlier commits, and hence broke the tests. Ah well.

Fixing CS violations.

IMHO this is RTBC-worthy.

gabesullice’s picture

Status: Needs review » Needs work
+++ b/tests/src/Functional/ExternalNormalizersTest.php
@@ -0,0 +1,149 @@
+      'Format-agnostic @DataType-level normalizers SHOULD be able to affect the JSON API normalization' => [
+        // \Drupal\jsonapi_test_field_type\Normalizer\StringNormalizer::normalize()

s/jsonapi_test_field_type/jsonapi_test_data_type/

I think

wim leers’s picture

Status: Needs work » Needs review
StatusFileSize
new16.66 KB
new25.39 KB

🦅👀

👍

wim leers’s picture

StatusFileSize
new836 bytes
new9.57 KB

Ignore #10, unwanted cruft in there.

gabesullice’s picture

Status: Needs review » Reviewed & tested by the community

  • Wim Leers committed 0492966 on 8.x-1.x
    Issue #2950486 by Wim Leers, gabesullice: Test coverage: custom modules...
wim leers’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.