install_wpdb_mock(); WPDO_Custom_Table_Registry::reset_for_tests(); $this->adapter = new WPDO_HivePress_Messages_Adapter(); } public function test_implements_adapter_interface(): void { $this->assertInstanceOf( WPDO_HivePress_Adapter::class, $this->adapter ); } public function test_identity(): void { $this->assertSame( 'hivepress-messages', $this->adapter->plugin_slug() ); $this->assertSame( 'HivePress\\Messages\\Plugin', $this->adapter->detection_class() ); $this->assertSame( 'hp_message', WPDO_HivePress_Messages_Adapter::COMMENT_TYPE ); } public function test_registers_no_shadow_table(): void { $registry = WPDO_Custom_Table_Registry::instance(); $this->adapter->on_register_custom_tables( $registry ); $this->assertSame( array(), $registry->all() ); } public function test_binds_no_comment_hooks(): void { $GLOBALS['_wp_filter_callbacks'] = array(); $this->adapter->on_register_event_hooks(); $this->assertArrayNotHasKey( 'wp_insert_comment', $GLOBALS['_wp_filter_callbacks'] ); $this->assertArrayNotHasKey( 'wp_set_comment_status', $GLOBALS['_wp_filter_callbacks'] ); $this->assertArrayNotHasKey( 'deleted_comment', $GLOBALS['_wp_filter_callbacks'] ); } public function test_migrations_is_empty(): void { $this->assertSame( array(), $this->adapter->migrations() ); } }