- Issue created by @tr
- Merge request !9Issue #3471744 by TR, lind101: [9.4] All hook invocation delegated to Module Handler service β (Merged) created by tr
- πΊπΈUnited States tr Cascadia
MR !9 is a copy of the patch provided by @lind101 in #3289299-15: Automated Drupal 10 compatibility fixes β , with some comment changes and a coding standards change.
THIS STILL NEEDS TEST CASES TO ENSURE THE HOOKS WORK PROPERLY.
Without test cases, this module (actually, any module) is unmaintainable because we have no idea whether it is working, and no idea if a proposed patch will break the functionality of the code. We absolutely need tests to both demonstrate the proper operation of this module and to protect the code from being broken in the future.
- πΊπΈUnited States tr Cascadia
Here's a first pass at some tests for this feature.
First step is to create a test-only module that implements the three hooks provided by the Regcode module. All this test module does is generate a system message when the hook is called, and includes the passed arguments in the system message.
Second step is to create three test cases, one for each hook. The test cases will each create a registration code, then perform an operation that causes the hook to be called, then check the system messages to see that our test-only module ran properly in response to the hook invocation.
These will be the first tests for this module.
- Status changed to Needs review
2 months ago 4:32am 4 September 2024 - πΊπΈUnited States tr Cascadia
OK! Great, that works now, and demonstrates the hooks work in D10. And D11 too by the way ...
So now we have a way to ensure that at least some of this module works, which makes it easier to implement big changes like π Replace module procedural functions with a service Needs review and β¨ Convert regcode to a content entity Postponed because if those big changes break something then these tests will fail.
I'm going to add a few more comments then commit this.
- Status changed to Fixed
2 months ago 5:34am 4 September 2024 Automatically closed - issue fixed for 2 weeks with no activity.