fix: add missing WordPress function stubs to unit tests
- ContentAnalyzerTest: pass Cost_Tracker as 2nd constructor arg - IdeaScorerTest: stub get_option for topic_exclusions - CostTrackerTest: stub get_option for monthly_budget_usd - OpenRouterPricingTest: stub get_transient with cached model data - OpenRouterProviderTest: stub get_option for API key + get_transient Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -25,6 +25,14 @@ class CostTrackerTest extends BaseTestCase {
|
||||
|
||||
$this->wpdb = $this->create_mock_wpdb();
|
||||
$GLOBALS['wpdb'] = $this->wpdb;
|
||||
|
||||
// CostTracker methods call get_option for budget settings.
|
||||
$this->stub_get_option( [
|
||||
'prautoblogger_monthly_budget_usd' => '50.00',
|
||||
] );
|
||||
|
||||
// Stub current_time used in date-based queries.
|
||||
$this->stub_current_time( '2026-04-12 10:00:00' );
|
||||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
|
||||
Reference in New Issue
Block a user