From f5f1482b7af0d970afa0ccd1dafdf3af82807688 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 29 Apr 2025 23:18:55 -0400 Subject: [PATCH] Autoload para pruebas --- app/test.bootstrap.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/test.bootstrap.php b/app/test.bootstrap.php index 7f67efc..5e31ebc 100644 --- a/app/test.bootstrap.php +++ b/app/test.bootstrap.php @@ -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();