Commit 5fb654f9 by Klimov Paul

'MongoDbTestCase::loadClassMap()' refactored

parent f6ef4aac
...@@ -58,11 +58,10 @@ class MongoDbTestCase extends TestCase ...@@ -58,11 +58,10 @@ class MongoDbTestCase extends TestCase
{ {
$baseNameSpace = 'yii/mongodb'; $baseNameSpace = 'yii/mongodb';
$basePath = realpath(__DIR__. '/../../../../extensions/mongodb'); $basePath = realpath(__DIR__. '/../../../../extensions/mongodb');
$files = FileHelper::findFiles($basePath);
foreach ($files as $file) { $alias = '@' . $baseNameSpace;
$classRelativePath = str_replace($basePath, '', $file); if (!in_array($alias, Yii::$aliases)) {
$classFullName = str_replace(['/', '.php'], ['\\', ''], $baseNameSpace . $classRelativePath); Yii::setAlias($alias, $basePath);
Yii::$classMap[$classFullName] = $file;
} }
} }
......
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