Skip to content

Commit

Permalink
fix autoload
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 committed Mar 1, 2024
1 parent a2ec772 commit e9d9593
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions tests/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
throw new \Exception('Unknown configuration! Pimcore project root not found, please set env variable PIMCORE_PROJECT_ROOT.');
}


$pimcoreTestsSupportDir = $pimcoreTestDir . '/Support';

//Pimcore 10 BC layer
Expand All @@ -27,28 +28,24 @@

include $pimcoreTestsSupportDir . '/Util/Autoloader.php';

return function (array $context) {

\Pimcore\Bootstrap::setProjectRoot();
\Pimcore\Bootstrap::bootstrap();

//error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);
\Pimcore\Bootstrap::setProjectRoot();
\Pimcore\Bootstrap::bootstrap();

Autoloader::addNamespace('Pimcore\Tests', $pimcoreTestsSupportDir); //Pimcore 10 BC layer
Autoloader::addNamespace('Pimcore\Tests\Support', $pimcoreTestsSupportDir);
Autoloader::addNamespace('Pimcore\Model\DataObject', PIMCORE_CLASS_DIRECTORY . '/DataObject');
Autoloader::addNamespace('DataHubBundle\Tests', __DIR__);
Autoloader::addNamespace('DataHubBundle\Tests', __DIR__ . '/_support');
//error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING);

Autoloader::addNamespace('Pimcore\Tests', $pimcoreTestsSupportDir); //Pimcore 10 BC layer
Autoloader::addNamespace('Pimcore\Tests\Support', $pimcoreTestsSupportDir);
Autoloader::addNamespace('Pimcore\Model\DataObject', PIMCORE_CLASS_DIRECTORY . '/DataObject');
Autoloader::addNamespace('DataHubBundle\Tests', __DIR__);
Autoloader::addNamespace('DataHubBundle\Tests', __DIR__ . '/_support');

echo __DIR__ . '/_support';

if (!defined('TESTS_PATH')) {
define('TESTS_PATH', __DIR__);
}
echo __DIR__ . '/_support';

if (!defined('PIMCORE_TEST')) {
define('PIMCORE_TEST', true);
}
if (!defined('TESTS_PATH')) {
define('TESTS_PATH', __DIR__);
}

};
if (!defined('PIMCORE_TEST')) {
define('PIMCORE_TEST', true);
}

0 comments on commit e9d9593

Please sign in to comment.