mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
light bootstrap for unit tests
This commit is contained in:
8
Tests/bootstrap.php
Normal file
8
Tests/bootstrap.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
spl_autoload_register(function ($class) {
|
||||
if (preg_match('#^DesignPatterns\\\\(.+)$#', $class, $ret)) {
|
||||
$relPath = str_replace('\\', DIRECTORY_SEPARATOR, $ret[1]);
|
||||
require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . $relPath . '.php';
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user