install_wpdb_mock(); $reflect = new ReflectionClass( WPDO_Schema_Registry::class ); $prop = $reflect->getProperty( 'instance' ); $prop->setAccessible( true ); $prop->setValue( null, null ); $this->adapter = new WPDO_HivePress_Statistics_Adapter(); } public function test_implements_adapter_interface(): void { $this->assertInstanceOf( WPDO_HivePress_Adapter::class, $this->adapter ); } public function test_identity(): void { $this->assertSame( 'hivepress-statistics', $this->adapter->plugin_slug() ); $this->assertSame( 'HivePress\\Statistics\\Plugin', $this->adapter->detection_class() ); } public function test_on_register_fields_registers_warm_counters(): void { $registry = WPDO_Schema_Registry::instance(); $this->adapter->on_register_fields( $registry ); $views = $registry->get_field( 'hp_listing', 'hp_view_count' ); $this->assertSame( 'warm', $views['zone'] ); $clicks = $registry->get_field( 'hp_listing', 'hp_click_count' ); $this->assertSame( 'warm', $clicks['zone'] ); } public function test_score_aggregates_to_nine_eight_eight(): void { $this->assertSame( 9.88, $this->adapter->suitability_score()['aggregate'] ); } }