fix: add WP constants, WP_Query mock, fix arg types and stubs

- bootstrap: define DAY_IN_SECONDS, ARRAY_A, mock WP_Query class
- CostTrackerTest: fix log_api_call signature (post_id is ?int, not string)
- PublisherTest: fix apply_filters usage, remove broken expectation
- OpenRouterPricingTest: fix assertGreaterThanOrEqual direction
- OpenRouterProviderTest: add wp_salt stub, use empty API key
- ContentAnalyzerTest: add apply_filters, current_time, get_results stubs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
peptiderepo
2026-04-12 08:17:18 +07:00
parent ece032efe5
commit 7728db5671
6 changed files with 81 additions and 25 deletions

View File

@@ -147,10 +147,14 @@ class CostTrackerTest extends BaseTestCase {
->method( 'insert' )
->willReturn( 1 );
// We don't know exact params, but test that it's callable.
// Signature: log_api_call(?int $post_id, string $stage, string $provider,
// string $model, int $prompt_tokens, int $completion_tokens,
// float $estimated_cost, float $duration_seconds).
$tracker->log_api_call(
'openai/gpt-4',
123,
'analysis',
'openrouter',
'openai/gpt-4',
500,
250,
0.01,