Newer
Older
smart-home-server / server / tests / bootstrap.php
<?php

require_once __DIR__ . '/../Fury/fury.php';
require_once __DIR__ . '/TestApp.php';

// PHPUnit auto-loads via composer, but Fury's own autoloader
// handles the legacy namespace-to-path mapping.
// We just need to ensure Fury/__autoload.php is included (done via fury.php).

$tb = new \Fury\Modules\ThinBuilder\ThinBuilder([
	'dblib' => 'sqlite',
	'dbname' => ':memory:',
], null, false);

$testApp = new TestApp();
$testApp->thin_builder = $tb;
$testApp->utils = new \SHServ\Utils();
$testApp->sessions = new \SHServ\Sessions();

\Fury\Kernel\AppContainer::set_app($testApp);

// Minimal FCONF for message lookups in Utils
if (!defined('FCONF')) {
	define('FCONF', [
		'app_name' => 'TestApp',
		'text_msgs' => [
			'not_found' => 'Not found',
			'invalid_request' => 'Invalid request',
			'rate_limit_exceeded' => 'Too many requests',
			'unauthorized' => 'Unauthorized',
			'forbidden' => 'Forbidden',
			'device_not_found' => 'Device not found',
			'script_not_exists' => 'Script not found',
			'area_not_found' => 'Area not found',
			'invalid_input' => 'Invalid input',
			'internal_error' => 'Internal server error',
		],
	]);
}