Skip to content

Commit 9773705

Browse files
committed
tests: test Registry->get_all_registered() instead of downstream
1 parent bd314e7 commit 9773705

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

tests/phpunit/tests/connectors/wpConnectorRegistry.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,4 +381,16 @@ public function test_get_instance_returns_same_instance() {
381381

382382
$this->assertSame( $instance1, $instance2 );
383383
}
384+
385+
/**
386+
* Test registration skips AI connectors when AI is not supported.
387+
*/
388+
public function test_register_skips_when_ai_not_supported() {
389+
add_filter( 'wp_supports_ai', '__return_false' );
390+
391+
$this->registry->register( 'first', self::$default_args );
392+
393+
$all = $this->registry->get_all_registered();
394+
$this->assertCount( 0, $all );
395+
}
384396
}

tests/phpunit/tests/connectors/wpConnectorsGetConnectorSettings.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ public function test_each_connector_has_required_fields(): void {
6464
}
6565
}
6666

67-
/**
68-
* Tests connectors return an empty array when AI is not supported.
69-
*/
70-
public function test_returns_empty_array_when_ai_not_supported(): void {
71-
// Temporarily disable AI support for this test.
72-
add_filter( 'wp_supports_ai', '__return_false' );
73-
74-
$settings = wp_get_connectors();
75-
$this->assertSame( array(), $settings );
76-
}
77-
7867
/**
7968
* @ticket 64730
8069
*/

0 commit comments

Comments
 (0)