Files
prautoblogger/tests/unit/Admin
peptiderepo 29a334b1ed test: fix BoardDataProviderTest WP_Query/WP_Post stub incompatibility
Functions\when('WP_Query') cannot intercept 'new WP_Query()' class
instantiation — Brain\Monkey only patches global functions, not
constructor calls. The board data provider's instanceof WP_Post check
also filtered out all stdClass mocks.

Fix:
- Add WP_Query:: static FIFO to bootstrap so tests
  can inject WP_Post arrays per-test without Brain\Monkey.
- Add WP_Post stub class to bootstrap (safe: not a function, no
  Patchwork conflict).
- Update BoardDataProviderTest to use WP_Post instances + queue
  instead of Functions\when('WP_Query').

Agent-Session: phase2-admin-m1-engineer
2026-06-12 14:08:36 +07:00
..