Files
2meet-data-optimizer-hivepr…/tests/unit/MembershipsAdapterTest.php
T
wpdev 0254e40d83
Tests / PHP Lint (pull_request) Successful in 50s
Tests / Unit Tests (pull_request) Successful in 58s
Tests / Integration Tests (pull_request) Successful in 57s
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
2026-09-26 01:13:35 +08:00

41 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
use PHPUnit\Framework\TestCase;
/**
* Tests for WPDO_HivePress_Memberships_Adapter.
*
* @covers WPDO_HivePress_Memberships_Adapter
*/
class HivePressMembershipsAdapterTest extends TestCase {
private WPDO_HivePress_Memberships_Adapter $adapter;
protected function setUp(): void {
// Reset Schema_Registry singleton via reflection.
$reflect = new ReflectionClass( WPDO_Schema_Registry::class );
$prop = $reflect->getProperty( 'instance' );
$prop->setAccessible( true );
$prop->setValue( null, null );
$this->adapter = new WPDO_HivePress_Memberships_Adapter();
}
public function test_implements_adapter_interface(): void {
$this->assertInstanceOf( WPDO_HivePress_Adapter::class, $this->adapter );
}
public function test_identity(): void {
$this->assertSame( 'hivepress-memberships', $this->adapter->plugin_slug() );
$this->assertSame( 'HivePress\\Memberships\\Plugin', $this->adapter->detection_class() );
$this->assertSame( 'HIVEPRESS_MEMBERSHIPS_VERSION', $this->adapter->detection_const() );
$this->assertSame( '2.0.0', $this->adapter->minimum_addon_version() );
}
public function test_score_aggregates_to_perfect_ten(): void {
$score = $this->adapter->suitability_score();
$this->assertSame( 10.0, $score['aggregate'] );
}
}