Problem/Motivation

The scanner cannot be tested against a real site — none of the three has an exported configuration, and a database dump is not a test fixture. Without tests it is the component whose bugs are hardest to notice, because a wrong map produces plausible-looking generated code.

Proposed resolution

  • A test module that installs a deliberately varied model: several bundles, every field type of the shape table, cardinality 1 and unlimited, required and optional, references to nodes, terms, media and paragraphs, nested paragraphs, a hierarchical vocabulary, two languages.
  • Kernel tests asserting the map for that model key by key, not just that it is non-empty.
  • Cases that are easy to get wrong: a bundle with no fields, a field with no data, a reference with no target bundles restricted, a cycle.

Remaining tasks

Everything. The fixture model is reused by every later stage, so it is worth building properly here.

Issue fork myrest-3620028

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sergeydruua created an issue. See original summary.

  • sergeydruua committed 78cbf047 on 1.0.x
    Issue #3620028: Give the scanner a fixture model and assert the map...
sergeydruua’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

sergeydruua’s picture

Status: Fixed » Closed (fixed)