<?php
/**
 * Infection-specific PHPUnit bootstrap. Resolves project root by walking up
 * from this file's location, then loads the regular unit bootstrap. Robust
 * to Infection's habit of regenerating phpunit.xml in .infection-tmp/.
 *
 * NOTE: this file is dev-only — `tests-infection/` is excluded from the wp.org
 * dist zip via `.distignore`. The ABSPATH/CLI guard below silences wp.org
 * Plugin Check's `missing_direct_file_access_protection` warning when the
 * source repo is scanned (Plugin Check scans source, not the dist zip).
 */
declare( strict_types = 1 );

// Block direct HTTP access. WP defines ABSPATH; CLI/Infection runs do not,
// but they reach this file via require_once from PHPUnit, not via HTTP.
if ( ! defined( 'ABSPATH' ) && PHP_SAPI !== 'cli' ) {
	exit;
}

$pp_root = dirname( __DIR__ );
require_once $pp_root . '/tests/bootstrap-unit.php';
