refactor(2meet-data-optimizer-hivepress-addon): stop registering Hot zone fields
- 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:
@@ -33,41 +33,8 @@ class HivePressMembershipsAdapterTest extends TestCase {
|
||||
$this->assertSame( '2.0.0', $this->adapter->minimum_addon_version() );
|
||||
}
|
||||
|
||||
public function test_on_register_fields_registers_three_hot_fields(): void {
|
||||
$registry = WPDO_Schema_Registry::instance();
|
||||
$this->adapter->on_register_fields( $registry );
|
||||
|
||||
// Plan fields.
|
||||
$expire_period = $registry->get_field( 'hp_membership_plan', 'hp_expire_period' );
|
||||
$this->assertSame( 'hot', $expire_period['zone'] );
|
||||
$this->assertStringContainsString( 'int', $expire_period['data_type'] );
|
||||
|
||||
$primary = $registry->get_field( 'hp_membership_plan', 'hp_primary' );
|
||||
$this->assertSame( 'hot', $primary['zone'] );
|
||||
$this->assertTrue( (bool) $primary['indexed'] );
|
||||
|
||||
// Membership field — the hottest path.
|
||||
$expired = $registry->get_field( 'hp_membership', 'hp_expired_time' );
|
||||
$this->assertSame( 'hot', $expired['zone'] );
|
||||
$this->assertTrue( (bool) $expired['indexed'] );
|
||||
$this->assertStringContainsString( 'bigint', $expired['data_type'] );
|
||||
}
|
||||
|
||||
public function test_doctor_check_reports_missing_tables_in_stub_env(): void {
|
||||
$result = $this->adapter->doctor_check();
|
||||
$this->assertFalse( $result['ok'] );
|
||||
$this->assertArrayHasKey( 'hp_membership_plan', $result['details'] );
|
||||
$this->assertArrayHasKey( 'hp_membership', $result['details'] );
|
||||
}
|
||||
|
||||
public function test_score_aggregates_to_perfect_ten(): void {
|
||||
$score = $this->adapter->suitability_score();
|
||||
$this->assertSame( 10.0, $score['aggregate'] );
|
||||
}
|
||||
|
||||
public function test_migrations_lists_both_hot_modules(): void {
|
||||
$mods = $this->adapter->migrations();
|
||||
$this->assertContains( 'hot_hp_membership_plan', $mods );
|
||||
$this->assertContains( 'hot_hp_membership', $mods );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user