<?php
// tests/bootstrap.php
// Minimal bootstrap for PHPUnit runs.

define('DSP_TEST_ROOT', dirname(__DIR__));

// Ensure Composer autoloader is available when dependencies are installed.
$composerAutoload = DSP_TEST_ROOT . '/vendor/autoload.php';
if (file_exists($composerAutoload)) {
    require_once $composerAutoload;
}

// Fall back to a simple autoloader for project classes when running without Composer.
spl_autoload_register(static function (string $class): void {
    $classPath = DSP_TEST_ROOT . '/classes/' . $class . '.php';
    if (is_file($classPath)) {
        require_once $classPath;
    }
});

// Load helper functions that rely on global scope.
require_once DSP_TEST_ROOT . '/includes/jupyter_helpers.php';
