From eae0239b0ca83e281c9a242fa00f90664aeb2e41 Mon Sep 17 00:00:00 2001 From: peptiderepo Date: Fri, 12 Jun 2026 03:18:10 +0000 Subject: [PATCH] fix(tests): add wpdb->posts and wpdb->options to mock setup AnalysisPromptsTest: analysis-prompts.php uses $wpdb->posts in the JOIN clause ({->posts}); mock stdClass must declare posts property. GenerationStatusPollerTest: Generation_Lock queries {->options} in acquire/release/get_acquired_at; mock stdClass must declare options. Agent-Session: prab-v0183-20260612 --- tests/unit/Core/AnalysisPromptsTest.php | 2 ++ tests/unit/Core/GenerationStatusPollerTest.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/unit/Core/AnalysisPromptsTest.php b/tests/unit/Core/AnalysisPromptsTest.php index 75c9f04..5e2340c 100644 --- a/tests/unit/Core/AnalysisPromptsTest.php +++ b/tests/unit/Core/AnalysisPromptsTest.php @@ -24,6 +24,8 @@ class AnalysisPromptsTest extends BaseTestCase { protected function setUp(): void { parent::setUp(); $this->wpdb = $this->create_mock_wpdb(); + // Analysis prompts uses $wpdb->posts (JOIN {->posts}) and prefix. + $this->wpdb->posts = 'wp_posts'; $GLOBALS['wpdb'] = $this->wpdb; } diff --git a/tests/unit/Core/GenerationStatusPollerTest.php b/tests/unit/Core/GenerationStatusPollerTest.php index 4fe74de..1c204b9 100644 --- a/tests/unit/Core/GenerationStatusPollerTest.php +++ b/tests/unit/Core/GenerationStatusPollerTest.php @@ -48,6 +48,8 @@ class GenerationStatusPollerTest extends BaseTestCase { $this->lock_acquired_at = null; $this->wpdb = $this->create_mock_wpdb(); + // Generation_Lock uses $wpdb->options in acquire/release/get_acquired_at. + $this->wpdb->options = 'wp_options'; $GLOBALS['wpdb'] = $this->wpdb; // Stub nonce check and capability check (always pass in unit tests).