assertSame( array(), WPDO_HivePress_Bootstrap::adapters() ); $this->assertSame( array(), WPDO_HivePress_Bootstrap::detected() ); // Second call must not fail or change state. WPDO_HivePress_Bootstrap::boot(); $this->assertSame( array(), WPDO_HivePress_Bootstrap::adapters() ); } public function test_adapter_for_returns_null_when_not_booted(): void { $this->assertNull( WPDO_HivePress_Bootstrap::adapter_for( 'hivepress' ) ); $this->assertNull( WPDO_HivePress_Bootstrap::adapter_for( 'hivepress-reviews' ) ); $this->assertNull( WPDO_HivePress_Bootstrap::adapter_for( '' ) ); } public function test_reset_clears_internal_state(): void { WPDO_HivePress_Bootstrap::boot(); WPDO_HivePress_Bootstrap::reset_for_tests(); // After reset boot() should run again; detected() should be re-populated // (still empty in the test env, but the call must not be skipped). WPDO_HivePress_Bootstrap::boot(); $this->assertIsArray( WPDO_HivePress_Bootstrap::detected() ); } public function test_should_bind_filter_short_circuits_binding(): void { // Even if HivePress were detected, the filter must be honoured. // We can't fake detection cleanly here without reflection, so instead // we assert the filter is at least exposed and called: no detection // → no adapter binding → empty adapters list regardless of filter. add_filter( 'wpdo_hivepress_should_bind', '__return_false' ); WPDO_HivePress_Bootstrap::boot(); $this->assertSame( array(), WPDO_HivePress_Bootstrap::adapters() ); } }