yiiapi/tests/bootstrap.php

(完整代码) 1KB

<?php

if (PHP_MAJOR_VERSION>=7 && PHP_MINOR_VERSION>=1) {
	// skip deprecation errors in PHP 7.1 and above
	error_reporting(E_ALL & ~E_DEPRECATED);
}

defined('YII_ENABLE_EXCEPTION_HANDLER') or define('YII_ENABLE_EXCEPTION_HANDLER',false);
defined('YII_ENABLE_ERROR_HANDLER') or define('YII_ENABLE_ERROR_HANDLER',false);
defined('YII_DEBUG') or define('YII_DEBUG',true);
$_SERVER['SCRIPT_NAME']='/'.basename(__FILE__);
$_SERVER['SCRIPT_FILENAME']=__FILE__;

if (version_compare(PHP_VERSION, '5.3', '>='))
	require_once(dirname(__FILE__).'/compatibility.php');

require_once(dirname(__FILE__).'/../framework/yii.php');
require_once(dirname(__FILE__).'/TestApplication.php');
// Support PHPUnit <=3.7 and >=3.8
if (@include_once('PHPUnit/Framework/TestCase.php')===false) // <= 3.7
	require_once('src/Framework/TestCase.php'); // >= 3.8

// make sure non existing PHPUnit classes do not break with Yii autoloader
Yii::$enableIncludePath = false;
Yii::setPathOfAlias('tests', dirname(__FILE__));
Yii::import('tests.*');

class CTestCase extends PHPUnit_Framework_TestCase
{
}


class CActiveRecordTestCase extends CTestCase
{
}

new TestApplication();

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。