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:
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* ADR-003: post fields converge on entity groups; the Hot zone is frozen.
|
||||
*
|
||||
* No HivePress adapter registers zone=hot fields or contributes hot_* FSM
|
||||
* modules. The fields they used to cover live in TMDO_HivePress_Entity_Groups.
|
||||
*/
|
||||
class NoHotZoneRegistrationTest extends TestCase {
|
||||
|
||||
private const ADAPTERS = array(
|
||||
'TMDO_HivePress_Core_Adapter',
|
||||
'TMDO_HivePress_Requests_Adapter',
|
||||
'TMDO_HivePress_Bookings_Adapter',
|
||||
'TMDO_HivePress_Memberships_Adapter',
|
||||
'TMDO_HivePress_Marketplace_Adapter',
|
||||
'TMDO_HivePress_Favorites_Adapter',
|
||||
'TMDO_HivePress_Reviews_Adapter',
|
||||
'TMDO_HivePress_Social_Links_Adapter',
|
||||
'TMDO_HivePress_Blocks_Adapter',
|
||||
'TMDO_HivePress_Seo_Adapter',
|
||||
'TMDO_HivePress_Messages_Adapter',
|
||||
'TMDO_HivePress_Statistics_Adapter',
|
||||
'TMDO_HivePress_Tags_Adapter',
|
||||
);
|
||||
|
||||
protected function setUp(): void {
|
||||
$prop = ( new ReflectionClass( TMDO_Schema_Registry::class ) )->getProperty( 'instance' );
|
||||
$prop->setAccessible( true );
|
||||
$prop->setValue( null, null );
|
||||
}
|
||||
|
||||
public function test_no_adapter_registers_hot_fields(): void {
|
||||
$registry = TMDO_Schema_Registry::instance();
|
||||
foreach ( self::ADAPTERS as $class ) {
|
||||
( new $class() )->on_register_fields( $registry );
|
||||
}
|
||||
|
||||
$this->assertSame( array(), $registry->get_zone_fields( 'hot' ) );
|
||||
$this->assertSame( 'cold', $registry->get_field_zone( 'hp_listing', 'hp_images' ), 'cold fields stay' );
|
||||
}
|
||||
|
||||
public function test_no_adapter_contributes_hot_modules(): void {
|
||||
foreach ( self::ADAPTERS as $class ) {
|
||||
$this->assertSame( array(), ( new $class() )->migrations(), $class );
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user