Needs work
Project:
Email Blocker
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
9 Feb 2022 at 06:26 UTC
Updated:
26 Apr 2022 at 11:10 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
binnythomas commentedAdding patch with a single test.
Comment #3
binnythomas commentedIgnore earlier patch. The current one has the tests.
Comment #4
gaurav.kapoor commentedComment #5
binnythomas commentedUpdated the patch with the following changes. Please review and test.
Comment #6
binnythomas commentedAdding a revised patch with the following changes.
1. Added a new automated PHP unit test for testing the configuration form.
2. Changes to the config variable naming to ensure consistency throughout the module with the name of the config variable in the schema file.
Regarding testing of mail sending and email blocking - As per the usual rule of writing tests we should test dependencies and sending of mails is a dependency. We might have to think of mocking sending of emails. Also, the key functionality is done via hook and as hooks are related to the API and not part of custom code they need not be tested. What do you think of this?
Comment #7
gaurav.kapoor commented1. Minor CS issues when applying the patch
2. Class LoadTest can be renamed to EmailBlockerTest.
3. Typo in line 43 of EmailBlockerAdminConfigTest.php file.
4. Unwanted import statement in EmailBlockerAdminConfigTest.php file.
Comment #8
gaurav.kapoor commentedComment #9
gaurav.kapoor commentedTests similar to those in this module https://git.drupalcode.org/project/reroute_email/-/tree/2.1.x/tests/src/... can be written for the email blocker module as well. All those can be taken up in a different issue as well.