woocommerce/tests/includes/code-hacking
Nestor Soriano db58b51de3 Barebones implementation of a code hacker for unit tests.
The "code hacker" is a class that hooks on filesystem events
(using stream_wrapper_unregister) in order to allow for dynamically
modifying the content of PHP code files while they are loaded.
The code hacker class allows registering hacks, which are
functions that take source code as input and return the modified code.
A hack can be a standalone function or a class with a "hack" method.

A few hacks are provided off the shelf. One allows mocking standalone
PHP functions (WP, WOO or not), another one allows mocking static
methods, and there's the one that removes the "final" qualifier
from a class definition. This helps unit testing stuff that would
otherwise be quite hard to test.
2020-05-20 09:56:25 +02:00
..
hacks Barebones implementation of a code hacker for unit tests. 2020-05-20 09:56:25 +02:00
code-hacker-test-hook.php Barebones implementation of a code hacker for unit tests. 2020-05-20 09:56:25 +02:00
code-hacker.php Barebones implementation of a code hacker for unit tests. 2020-05-20 09:56:25 +02:00