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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user