TestCase.php 761 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
<?php

namespace yiiunit\extensions\authclient;

use yii\helpers\FileHelper;
use Yii;

/**
 * TestCase for "authclient" extension.
 */
class TestCase extends \yiiunit\TestCase
{
	/**
	 * Adds sphinx extension files to [[Yii::$classPath]],
	 * avoiding the necessity of usage Composer autoloader.
	 */
17
	public static function loadClassMap()
18 19
	{
		$baseNameSpace = 'yii/authclient';
Qiang Xue committed
20
		$basePath = realpath(__DIR__. '/../../../../extensions/authclient');
21 22 23 24 25 26 27
		$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();