34 lines
842 B
PHP
34 lines
842 B
PHP
<?php
|
|
/**
|
|
* Bootstrap dla testów PHPUnit
|
|
*/
|
|
|
|
// Załaduj Composer autoloader (jeśli istnieje)
|
|
if (file_exists(__DIR__ . '/../vendor/autoload.php')) {
|
|
require_once __DIR__ . '/../vendor/autoload.php';
|
|
} else {
|
|
// Ręczny autoloader dla Domain
|
|
spl_autoload_register(function ($class) {
|
|
$prefix = 'Domain\\';
|
|
$baseDir = __DIR__ . '/../autoload/Domain/';
|
|
|
|
$len = strlen($prefix);
|
|
if (strncmp($prefix, $class, $len) !== 0) {
|
|
return;
|
|
}
|
|
|
|
$relativeClass = substr($class, $len);
|
|
$file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php';
|
|
|
|
if (file_exists($file)) {
|
|
require $file;
|
|
}
|
|
});
|
|
}
|
|
|
|
// Załaduj Medoo
|
|
require_once __DIR__ . '/../libraries/medoo/medoo.php';
|
|
|
|
// Ustaw timezone
|
|
date_default_timezone_set('Europe/Warsaw');
|