diff --git a/tests/unit/Providers/OpenRouterProviderTest.php b/tests/unit/Providers/OpenRouterProviderTest.php index b650bd2..0f9d301 100644 --- a/tests/unit/Providers/OpenRouterProviderTest.php +++ b/tests/unit/Providers/OpenRouterProviderTest.php @@ -48,6 +48,9 @@ class OpenRouterProviderTest extends BaseTestCase { ); Functions\when( 'set_transient' )->justReturn( true ); + // Stub URL parsing. + Functions\when( 'wp_parse_url' )->alias( 'parse_url' ); + // Stub HTTP functions for API calls. Functions\when( 'wp_remote_post' )->justReturn( [ 'body' => '{"choices":[{"message":{"content":"test"},"finish_reason":"stop"}],"usage":{"prompt_tokens":10,"completion_tokens":5,"total_tokens":15}}', diff --git a/tests/unit/Providers/OpenRouterValidatorTest.php b/tests/unit/Providers/OpenRouterValidatorTest.php index f7f4bf7..540e21f 100644 --- a/tests/unit/Providers/OpenRouterValidatorTest.php +++ b/tests/unit/Providers/OpenRouterValidatorTest.php @@ -30,6 +30,9 @@ class OpenRouterValidatorTest extends BaseTestCase { // Stub wp_salt for encryption. Functions\when( 'wp_salt' )->justReturn( 'test_salt_key_for_unit_tests' ); + // Stub URL parsing. + Functions\when( 'wp_parse_url' )->alias( 'parse_url' ); + // Stub HTTP functions. Functions\when( 'wp_remote_get' )->justReturn( [ 'body' => '{}',