884fd08462
The unit testing bootstrap loads and initializes WooCommerce, this loads a bunch of code files that can't then be hacked in the test hooks. A workaround is provided in this commit for the case of hacking static methods. A new StaticWrapper class is created that allows defining mock methods after the code file has been loaded. This is applied to all classes from a fixed list in the bootstrap, before WooCommerce is initialized. The list should be kept up to date with the list of classes that require such workaround. |
||
---|---|---|
.. | ||
data | ||
framework | ||
includes | ||
unit-tests | ||
bootstrap.php | ||
classes-that-need-static-wrapper.php |