assertSame( array(), $conflicts ); $this->assertFalse( WPDO_HivePress_Conflict_Guard::has_conflict() ); } public function test_conflict_detected_when_hpct_const_defined(): void { // Simulate hp-custom-tables presence via constant probe. if ( ! defined( 'HPCT_VERSION' ) ) { define( 'HPCT_VERSION', '1.0.0' ); } WPDO_HivePress_Conflict_Guard::reset_for_tests(); $conflicts = WPDO_HivePress_Conflict_Guard::detect_conflicts(); $this->assertContains( 'hp-custom-tables', $conflicts ); $this->assertTrue( WPDO_HivePress_Conflict_Guard::has_conflict() ); } public function test_check_and_warn_safe_when_no_conflicts(): void { WPDO_HivePress_Conflict_Guard::reset_for_tests(); // Should not throw or render anything when clean. $this->expectOutputString( '' ); WPDO_HivePress_Conflict_Guard::check_and_warn(); } public function test_render_notice_does_nothing_when_not_admin(): void { // is_admin() stub returns false by default. ob_start(); WPDO_HivePress_Conflict_Guard::render_notice(); $out = ob_get_clean(); $this->assertSame( '', $out ); } public function test_memo_cache_avoids_repeat_probing(): void { WPDO_HivePress_Conflict_Guard::reset_for_tests(); $first = WPDO_HivePress_Conflict_Guard::detect_conflicts(); $second = WPDO_HivePress_Conflict_Guard::detect_conflicts(); $this->assertSame( $first, $second ); } }