Commit 5fb654f9 by Klimov Paul

'MongoDbTestCase::loadClassMap()' refactored

parent f6ef4aac
......@@ -58,11 +58,10 @@ class MongoDbTestCase extends TestCase
{
$baseNameSpace = 'yii/mongodb';
$basePath = realpath(__DIR__. '/../../../../extensions/mongodb');
$files = FileHelper::findFiles($basePath);
foreach ($files as $file) {
$classRelativePath = str_replace($basePath, '', $file);
$classFullName = str_replace(['/', '.php'], ['\\', ''], $baseNameSpace . $classRelativePath);
Yii::$classMap[$classFullName] = $file;
$alias = '@' . $baseNameSpace;
if (!in_array($alias, Yii::$aliases)) {
Yii::setAlias($alias, $basePath);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment