fix: resolve PHPUnit failures from M4 remediation commit

- 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
This commit is contained in:
peptiderepo
2026-06-14 14:07:02 +00:00
parent 165921e8ef
commit f2a00d421d
4 changed files with 52 additions and 26 deletions

View File

@@ -137,6 +137,9 @@ class GenerationCheckpointRunnerTest extends BaseTestCase {
*/
public function test_generate_tick_finalizes_when_queue_is_empty(): void {
// No queue option => get_option returns false (default from setUp alias).
// wire_wpdb_for_lock() provides $wpdb so Helpers::finalize() ->
// Generation_Lock::release() can run without "Call to member on null".
$this->wire_wpdb_for_lock();
\PRAutoBlogger_Generation_Checkpoint_Runner::on_generate_tick();
$this->assertNotContains(