refactor(2meet-data-optimizer-hivepress-addon): stop registering Hot zone fields
Tests / PHP Lint (pull_request) Successful in 50s
Tests / Unit Tests (pull_request) Successful in 58s
Tests / Integration Tests (pull_request) Successful in 57s

- ADR-003 step 4 (AddOn side): core, requests, bookings, memberships and
  marketplace adapters no longer register zone=hot fields or contribute
  hot_* FSM modules; their keys live in TMDO_HivePress_Entity_Groups.
  Cold/warm registrations are unchanged.
- Hot-table doctor probes go with them (trait defaults apply). The
  hot-clause query rewrite and cron optimizer are now inert and are left
  for the ADR step-5 removal together with core's hot path.
- New NoHotZoneRegistrationTest pins the invariant across all 13 adapters;
  per-adapter hot assertions removed.
- Verify: HP unit 142 / integration 49 green, phpcs clean (WordPress)
- PR: PR-037
This commit is contained in:
2026-09-26 01:13:35 +08:00
parent 0e260ee3a9
commit 0254e40d83
11 changed files with 71 additions and 527 deletions
-29
View File
@@ -46,29 +46,10 @@ class HivePressCoreAdapterTest extends TestCase {
$this->assertSame( '1.7.0', $this->adapter->minimum_addon_version() );
}
public function test_migrations_returns_listing_and_vendor_modules(): void {
$mods = $this->adapter->migrations();
$this->assertContains( 'hot_hp_listing', $mods );
$this->assertContains( 'hot_hp_vendor', $mods );
}
public function test_on_register_fields_populates_schema_registry(): void {
$registry = WPDO_Schema_Registry::instance();
$this->adapter->on_register_fields( $registry );
// Listing hot fields.
$drafted = $registry->get_field( 'hp_listing', 'hp_drafted' );
$this->assertIsArray( $drafted );
$this->assertSame( 'hot', $drafted['zone'] );
$this->assertTrue( (bool) $drafted['indexed'] );
$expired = $registry->get_field( 'hp_listing', 'hp_expired_time' );
$this->assertSame( 'hot', $expired['zone'] );
$this->assertStringContainsString( 'bigint', $expired['data_type'] );
$featured_time = $registry->get_field( 'hp_listing', 'hp_featured_time' );
$this->assertSame( 'hot', $featured_time['zone'] );
// Vendor cold blob.
$vendor_image = $registry->get_field( 'hp_vendor', 'hp_image' );
$this->assertIsArray( $vendor_image );
@@ -87,16 +68,6 @@ class HivePressCoreAdapterTest extends TestCase {
}
}
public function test_doctor_check_reports_table_status(): void {
$result = $this->adapter->doctor_check();
$this->assertIsArray( $result );
$this->assertArrayHasKey( 'ok', $result );
$this->assertArrayHasKey( 'message', $result );
$this->assertArrayHasKey( 'details', $result );
// The stub $wpdb returns null for SHOW TABLES, so tables appear missing → ok=false.
$this->assertFalse( $result['ok'] );
}
public function test_optimize_query_extracts_hot_clauses(): void {
$registry = WPDO_Schema_Registry::instance();
$this->adapter->on_register_fields( $registry );