You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inheritance from namespace other than \PHPUnit\... and the same that module is in is forbidden
Reason
TLDR: Avoid unnecessary coupling between modules.
While working with Unit Tests migration for Magento Commerce / B2B, we have faced multiple weird types of inheritance introduced - eg. Unit Test completely unrelated to Magento Catalog, inherited Unit Test from Magento Catalog to get the setUp executed and mocks created (that is the only reason). Changes introduced to Magento Catalog caused failures of Commerce modules Unit Tests. That is unacceptable, as the unit of responsibility for Magento Commerce module hasn't changed and if the mocks were independent - the test would still pass.
Rule
Inheritance from namespace other than
\PHPUnit\...
and the same that module is in is forbiddenReason
TLDR: Avoid unnecessary coupling between modules.
While working with Unit Tests migration for Magento Commerce / B2B, we have faced multiple weird types of inheritance introduced - eg. Unit Test completely unrelated to Magento Catalog, inherited Unit Test from Magento Catalog to get the
setUp
executed and mocks created (that is the only reason). Changes introduced to Magento Catalog caused failures of Commerce modules Unit Tests. That is unacceptable, as the unit of responsibility for Magento Commerce module hasn't changed and if the mocks were independent - the test would still pass.Implementation
CC
@slavvka @dmytro-ch
The text was updated successfully, but these errors were encountered: