diff --git a/test/init.php b/test/init.php index e3317732a0..23acb0c613 100644 --- a/test/init.php +++ b/test/init.php @@ -1,10 +1,19 @@ loadCommon() 方法创建名为 tester 的commonModel对象。 + * This file build a app instance and provide a instance of commonModel named as tester by $app->loadCommon(). + * + * All request of entries should be routed by this router. + * + * @copyright Copyright 2009-2017 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com) + * @license ZPL (http://zpl.pub/page/zplv12.html) + * @author Guanxing + * @package ZenTaoPMS + * @version $Id: $ + * @link http://www.zentao.net + */ +/* Set the error reporting. */ +error_reporting(0); /* Load the framework. */ include '../framework/router.class.php'; @@ -12,15 +21,5 @@ include '../framework/control.class.php'; include '../framework/model.class.php'; include '../framework/helper.class.php'; -/* Create the app. */ -$app = router::createApp('pms', dirname(dirname(__FILE__))); - -/* Reconnect to the test database. */ -include '../config/test.php'; -$app->connectDB(); - -/* Load the common module. */ -$common = $app->loadCommon(); - -/* Change directory back again. */ -chdir($cwd); +$app = router::createApp('pms', dirname(dirname(__FILE__)), 'router'); +$tester = $app->loadCommon();