woocommerce/tests/legacy
Nestor Soriano ca9ed93b9a Added dependency injection infrastructure for unit tests:
- Added a new class `ExtendedContainer` that extends League's container.
  - `add` modified to reject classes not in the root Woo namespace.
  - Has two new methods, `replace` and `reset_resolved`.
  - It's used as the underlying container instead of League's one
    in `Container`, but the new methods are not exposed.
- At unit test bootstrap time the globally registered container is
  replaced with the extended one that `Container` stores
  (grabbed from private property using reflection).
- A new `MockableLegacyProxy` is added. It inherits from `LegacyProxy`
  and allows to mock functions, static methods and legacy classes.
  - The registeed `LegacyProxy` is replaced with the mockable version
    during unit test bootstrap.
- A PHPUnit hook is added to reset the mockable proxy to its initial
  state (so that nothing is mocked) before each test.
- `WC_Unit_Test_Case` gets helper methods to mock functions, static
  methods and classes without having to retrieve the proxy class.
2020-07-24 09:23:05 +02:00
..
data Add unit test and a sample Woo plugin file 2020-05-01 22:47:08 +05:30
framework Added dependency injection infrastructure for unit tests: 2020-07-24 09:23:05 +02:00
includes Moved PHPUnit suite into tests/legacy 2020-04-24 13:53:40 -07:00
unit-tests Added a test to verify the rating ordering for products 2020-07-13 13:35:00 -07:00
bootstrap.php Added dependency injection infrastructure for unit tests: 2020-07-24 09:23:05 +02:00
classes-with-mockable-static-methods.php Code hacker resdesign for single-load of code files. 2020-06-02 19:06:53 +02:00
mockable-functions.php Code hacker resdesign for single-load of code files. 2020-06-02 19:06:53 +02:00