Skip to content

Commit 007b572

Browse files
committed
chore: fix test and cleanup
1 parent d0b4a03 commit 007b572

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/wp-includes/ai-client/class-wp-ai-client-prompt-builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function __construct( ProviderRegistry $registry, $prompt = null ) {
180180
try {
181181
if ( ! wp_supports_ai() ) {
182182
// The catch block will convert this to a WP_Error.
183-
throw new \RuntimeException( __( 'AI features are not supported in the current environment.' ) );
183+
throw new \RuntimeException( __( 'AI features are not supported in this environment.' ) );
184184
}
185185

186186
$this->builder = new PromptBuilder( $registry, $prompt );

src/wp-includes/class-wp-connector-registry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function register( string $id, array $args ): ?array {
144144
return null;
145145
}
146146

147-
if ( 'ai_provider' === $args['type'] & ! wp_supports_ai() ) {
147+
if ( 'ai_provider' === $args['type'] && ! wp_supports_ai() ) {
148148
// No need for a `doing_it_wrong` as AI support is disabled intentionally.
149149
return null;
150150
}

tests/phpunit/tests/ai-client/wpAiClientPrompt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,6 @@ public function test_returns_error_builder_when_ai_not_supported(): void {
4949
$error = $error_prop->getValue( $builder );
5050

5151
$this->assertInstanceOf( WP_Error::class, $error );
52-
$this->assertSame( 'AI features are not supported in the current environment.', $error->get_error_message() );
52+
$this->assertSame( 'AI features are not supported in this environment.', $error->get_error_message() );
5353
}
5454
}

0 commit comments

Comments
 (0)