'eh_a', 'type' => 'text' ) ) ); TMDO_Entity_Registry::register_group( 'user', 'eh_two', array( array( 'key' => 'eh_b', 'type' => 'text' ) ) ); } protected function tearDown(): void { $GLOBALS['_wp_next_scheduled'] = array(); TMDO_Entity_Registry::init(); } private function backfill_active( string $entity_type ): bool { $m = new ReflectionMethod( TMDO_Entity_Health::class, 'is_backfill_active' ); $m->setAccessible( true ); return (bool) $m->invoke( null, $entity_type ); } public function test_a_backfill_scheduled_for_one_group_is_seen(): void { $GLOBALS['_wp_next_scheduled']['wpdo_entity_backfill_batch'][ md5( serialize( array( 'user', 'eh_two' ) ) ) ] = time() + 5; $this->assertTrue( $this->backfill_active( 'user' ) ); $this->assertFalse( $this->backfill_active( 'post' ), 'other entities are not affected' ); } public function test_no_scheduled_batch_means_no_backfill(): void { $this->assertFalse( $this->backfill_active( 'user' ) ); } }