<?php
/**
 * Feature-test bootstrap.
 *
 * The app normally derives ENVIRONMENT/PROTOCOL/DB-host constants from HTTP_HOST
 * in app/Config/Constants.php. The stock CI4 test bootstrap pre-defines
 * ENVIRONMENT='testing', which skips that block — so we define the few env
 * constants the framework/config needs, then chain the framework test bootstrap.
 *
 * Admin DB creds are read at runtime from the dev oci ini so no secret is
 * committed. Other connection groups fall back to env()/localhost (lazy; the
 * Lists feature only uses the Admin 'default' group).
 */
defined('PROTOCOL')        || define('PROTOCOL', 'http://');
defined('DOMAIN_PATH')     || define('DOMAIN_PATH', 'localhost/');
defined('DEV_USER')        || define('DEV_USER', '');
defined('MSACOMMON_PATH')  || define('MSACOMMON_PATH', '/nonexistent-msacommon/');

$ini = @parse_ini_file('/usr/share/php/adDbfileNew_oci.ini');
if (is_array($ini)) {
    defined('MSACOMMON_DB_HOST_ADMIN') || define('MSACOMMON_DB_HOST_ADMIN', $ini['host'] ?? '127.0.0.1');
    defined('MSACOMMON_DB_USER_ADMIN') || define('MSACOMMON_DB_USER_ADMIN', $ini['user'] ?? 'dev');
    defined('MSACOMMON_DB_PASS_ADMIN') || define('MSACOMMON_DB_PASS_ADMIN', $ini['pass'] ?? '');
}

require __DIR__ . '/../system/Test/bootstrap.php';
