Problem/Motivation

The refactoring ahead changes the base classes that other modules inherit from. There is no test that fails when an inherited method changes signature, disappears, or starts expecting a service the subclass does not have. The inventory taken across the sites that run this module: two dozen classes outside it, spread over ten modules, deriving from the plain resource base, the list resource, the contact form resource, the file upload resource and the metatag classes — and one of them decorates MyrestHelper itself.

Proposed resolution

  • Add a test module inside tests/modules with one subclass per inheritance pattern seen in the wild — a plain resource, a list resource, a contact form resource, a file upload resource, a metatag class, and a decorator of the helper service.
  • Assert that each one instantiates through the plugin manager or the container, answers a request, and gets the envelope — that is, that the contract a dependent module relies on still holds.
  • Run them in the same suite, so a base class change fails here before it fails on a site.
  • Keep the fixtures deliberately minimal: they encode the contract, not the behaviour of any particular dependent module.

Remaining tasks

Everything. Must land before any base class is touched.

Issue fork myrest-3618951

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 49e8f9ee on 1.0.x
    Issue #3618951: Cover the classes other modules extend with a satellite...
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)