* Provider tester object.

This commit is contained in:
Guanxiying
2021-04-23 11:22:46 +08:00
parent 142e73552d
commit 1640e5a20d
+17 -18
View File
@@ -1,10 +1,19 @@
<?php
/* Set error reporting level. */
error_reporting(E_ALL ^ E_STRICT);
/* Save current working directory and then change the directory of init.php. */
$cwd = getcwd();
chdir(dirname(__FILE__));
/**
* 本文件创建一个 app 示例,并且通过执行 $app->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 <guanxiying@easycorp.ltd>
* @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();