TestCase.php 839 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php

namespace yiiunit\extensions\authclient;

use yii\helpers\FileHelper;
use Yii;

/**
 * TestCase for "authclient" extension.
 */
class TestCase extends \yiiunit\TestCase
{
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
    /**
     * Adds sphinx extension files to [[Yii::$classPath]],
     * avoiding the necessity of usage Composer autoloader.
     */
    public static function loadClassMap()
    {
        $baseNameSpace = 'yii/authclient';
        $basePath = realpath(__DIR__. '/../../../../extensions/authclient');
        $files = FileHelper::findFiles($basePath);
        foreach ($files as $file) {
            $classRelativePath = str_replace($basePath, '', $file);
            $classFullName = str_replace(['/', '.php'], ['\\', ''], $baseNameSpace . $classRelativePath);
            Yii::$classMap[$classFullName] = $file;
        }
    }
28 29
}

Qiang Xue committed
30
TestCase::loadClassMap();