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:
@@ -112,7 +112,7 @@ class OpenRouterPricingTest extends BaseTestCase {
|
||||
$pricing = new \PRAutoBlogger_OpenRouter_Pricing();
|
||||
$cost = $pricing->estimate_cost( 'unknown/fake-model', 1000, 500 );
|
||||
|
||||
// Unknown models may return 0.0 or a fallback value
|
||||
// Unknown models may return 0.0 or a fallback value.
|
||||
$this->assertIsFloat( $cost );
|
||||
$this->assertGreaterThanOrEqual( 0.0, $cost );
|
||||
}
|
||||
@@ -139,8 +139,8 @@ class OpenRouterPricingTest extends BaseTestCase {
|
||||
$cost_small = $pricing->estimate_cost( 'google/gemini-2.0-flash-001', 100, 100 );
|
||||
$cost_large = $pricing->estimate_cost( 'google/gemini-2.0-flash-001', 1000, 1000 );
|
||||
|
||||
// Larger token counts should result in higher or equal costs.
|
||||
$this->assertLessThanOrEqual( $cost_large, $cost_small + 100 ); // Very loose check
|
||||
// Larger token counts should cost more or equal.
|
||||
$this->assertGreaterThanOrEqual( $cost_small, $cost_large );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user