- tests/bootstrap.php: add PRAUTOBLOGGER_DEFAULT_BOARD_COLUMN_LIMIT (20)
so unit tests can reference the constant used by the new settings-backed
LIMIT in class-board-gen-log-query.php and class-board-data-provider.php.
- tests/unit/Admin/BoardGenLogQueryTest.php: restructure to use make_wpdb()
helper that builds a fresh mock per test, so tests that need non-empty
get_results() rows can pass their own data without the setUp willReturn
blocking overrides.
- tests/unit/Admin/BoardHumanModifiedFlagTest.php: add get_option() stub to
setUp() covering prautoblogger_board_column_limit and
prautoblogger_board_published_window_days. Required because M4 made
get_in_review_cards() and get_published_cards() call get_option() for the
column limit (previously hardcoded); Brain\Monkey disallows unmocked calls.
- tests/unit/Core/GenerationCheckpointRunnerTest.php: call wire_wpdb_for_lock()
before on_generate_tick() in the empty-queue test so Generation_Lock::release()
(called from Helpers::finalize()) has a $wpdb available.
Agent-Session: phase2-admin-m4-20260614
P1 fixes (CTO remediation request, seq 47):
1. class-board-gen-log-query.php — both get_generating_cards() and
get_failed_cards() had two defects in prepare():
(a) missing comma between bound args (parse error: unexpected variable)
(b) reversed arg order: int limit was first, datetime string was second,
causing created_at >= <int> and LIMIT <datetime> silently.
Fix: $since (string, for %s) is now first; (int) limit (for %d) is second.
Both methods use settings-backed PRAUTOBLOGGER_DEFAULT_BOARD_COLUMN_LIMIT.
2. class-generation-checkpoint-runner.php — split private helpers into
class-generation-checkpoint-helpers.php to stay under the 300-line cap.
Runner: 267 lines. Helpers: 71 lines. Autoloader picks up helpers via
core/ directory scan (no registration change needed).
3. tests/unit/Admin/BoardGenLogQueryTest.php — new test that captures
prepare() call args and asserts arg[0] is string (the $since datetime)
and arg[1] is int (the limit), catching any future reversed-order
regression before CI. Also asserts card shape and column-limit option.
php -l clean on all 19 M4-touched files (verified via Hostinger SSH).
Agent-Session: phase2-admin-m4-20260614