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/moduleswith 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
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
Comment #4
sergeydruua commentedComment #6
sergeydruua commented