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:
peptiderepo
2026-04-12 08:05:43 +07:00
parent ab8d38a9c8
commit ece032efe5
5 changed files with 118 additions and 47 deletions

View File

@@ -14,6 +14,15 @@ use Brain\Monkey\Functions;
class IdeaScorerTest extends BaseTestCase {
protected function setUp(): void {
parent::setUp();
// IdeaScorer::score_and_rank() calls get_option('prautoblogger_topic_exclusions', '[]').
$this->stub_get_option( [
'prautoblogger_topic_exclusions' => '[]',
] );
}
/**
* Test Idea Scorer can be instantiated.
*/