0254e40d83
- 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
44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
<?php
|
||
declare(strict_types=1);
|
||
|
||
use PHPUnit\Framework\TestCase;
|
||
|
||
/**
|
||
* Tests for WPDO_HivePress_Bookings_Adapter (detect-only).
|
||
*
|
||
* @covers WPDO_HivePress_Bookings_Adapter
|
||
*/
|
||
class HivePressBookingsAdapterTest extends TestCase {
|
||
|
||
use WpdbMockTrait;
|
||
|
||
private WPDO_HivePress_Bookings_Adapter $adapter;
|
||
|
||
protected function setUp(): void {
|
||
$this->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_Bookings_Adapter();
|
||
}
|
||
|
||
public function test_implements_adapter_interface(): void {
|
||
$this->assertInstanceOf( WPDO_HivePress_Adapter::class, $this->adapter );
|
||
}
|
||
|
||
public function test_identity(): void {
|
||
$this->assertSame( 'hivepress-bookings', $this->adapter->plugin_slug() );
|
||
$this->assertSame( 'HivePress\\Bookings\\Plugin', $this->adapter->detection_class() );
|
||
}
|
||
|
||
public function test_score_reflects_unverified_perf_dimension(): void {
|
||
$score = $this->adapter->suitability_score();
|
||
// D8 reduced to 0.9 because schema is best-effort until addon installs.
|
||
$this->assertSame( 0.9, $score['d8_perf'] );
|
||
// Aggregate = (7 × 1.0 + 0.9) / 8 × 10 = 9.875 → 9.88.
|
||
$this->assertSame( 9.88, $score['aggregate'] );
|
||
}
|
||
}
|