Autoload para pruebas
This commit is contained in:
@ -147,6 +147,21 @@ class TestBootstrap
|
||||
}
|
||||
}
|
||||
|
||||
spl_autoload_register(function($className) {
|
||||
$baseTestPath = __DIR__ . "/tests";
|
||||
$namespaceMap = [
|
||||
"ProVM\\Integration\\" => "{$baseTestPath}/integration",
|
||||
"ProVM\\Unit\\" => "{$baseTestPath}/unit/src",
|
||||
"ProVM\\Performance\\" => "{$baseTestPath}/performance",
|
||||
];
|
||||
foreach ($namespaceMap as $namespace => $path) {
|
||||
if (str_starts_with($className, $namespace)) {
|
||||
require str_replace($namespace, "{$path}/", $className) . ".php";
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$bootstrap = new TestBootstrap($_ENV);
|
||||
Benchmark::execute([$bootstrap, 'run']);
|
||||
Benchmark::print();
|
||||
|
Reference in New Issue
Block a user