about summary refs log tree commit diff stats
path: root/tests/bootstrap.php
blob: a484982f0dbc9d713654a448f9c35937406c9873 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php
	set_include_path(dirname(__DIR__) ."/include" . PATH_SEPARATOR .
	get_include_path());

	putenv("IS_TESTING=true");

	require_once "common.php";

	// Stub validate_session() for unit tests (no DB needed).
	// Integration tests load sessions.php which defines the real function.
	if (!function_exists('validate_session')) {
		function validate_session() : bool {
			return !empty($_SESSION["owner"]) && !empty($_SESSION["pass_hash"]);
		}
	}