From f6594c7022fcfb766da60d3c51102bfaed0f573f Mon Sep 17 00:00:00 2001 From: wangyidong Date: Fri, 4 Jun 2021 12:10:48 +0800 Subject: [PATCH] * adjust version and adjust test. --- VERSION | 2 +- config/config.php | 2 +- module/execution/model.php | 4 ---- test/init.php | 26 +++++++++++++------------- test/model/branch/getbyid.php | 30 +++++++++++++----------------- test/model/trainplan/getbyid.php | 9 ++++----- test/zendata/trainplan.yaml | 8 ++++---- 7 files changed, 36 insertions(+), 45 deletions(-) diff --git a/VERSION b/VERSION index adbc6d2b1b..2bbd2b4b42 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -15.1 +15.0.1 diff --git a/config/config.php b/config/config.php index 186ed887a2..fad76cba64 100644 --- a/config/config.php +++ b/config/config.php @@ -16,7 +16,7 @@ if(!class_exists('config')){class config{}} if(!function_exists('getWebRoot')){function getWebRoot(){}} /* 基本设置。Basic settings. */ -$config->version = '15.1'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. +$config->version = '15.0.1'; // ZenTaoPHP的版本。 The version of ZenTaoPHP. Don't change it. $config->charset = 'UTF-8'; // ZenTaoPHP的编码。 The encoding of ZenTaoPHP. $config->cookieLife = time() + 2592000; // Cookie的生存时间。The cookie life time. $config->timezone = 'Asia/Shanghai'; // 时区设置。 The time zone setting, for more see http://www.php.net/manual/en/timezones.php. diff --git a/module/execution/model.php b/module/execution/model.php index 5480cce204..a29723cec4 100644 --- a/module/execution/model.php +++ b/module/execution/model.php @@ -500,10 +500,6 @@ class executionModel extends model if(!empty($execution->realBegan) and !empty($execution->realEnd)) $execution->realDuration = $this->loadModel('programplan')->getDuration($execution->realBegan, $execution->realEnd); } - /* Replace required language. */ - $this->lang->project->name = $this->lang->execution->name; - $this->lang->project->code = $this->lang->execution->code; - /* Update data. */ $this->dao->update(TABLE_EXECUTION)->data($execution) ->autoCheck($skipFields = 'begin,end') diff --git a/test/init.php b/test/init.php index 5b362be7c9..292c107b64 100644 --- a/test/init.php +++ b/test/init.php @@ -27,12 +27,12 @@ $app = router::createApp('pms', dirname(dirname(__FILE__)), 'router'); $tester = $app->loadCommon(); $config->zendataRoot = dirname(__FILE__) . DS . 'zendata'; -$config->zdPath = "/usr/local/zd/zd"; - +$config->zdPath = __DIR__ . "/runtime/zd/zd"; + /** * Save variable to $_result. - * - * @param mix $result + * + * @param mix $result * @access public * @return bool true */ @@ -45,9 +45,9 @@ function run($result) /** * Print expect data. - * - * @param string $key - * @param string $delimiter + * + * @param string $key + * @param string $delimiter * @access public * @return void */ @@ -65,13 +65,13 @@ function expect($key, $delimiter = ',') { $keyList = explode(',', $key); $dimension = 1; - foreach($_result as $value) + foreach($_result as $value) { if(is_array($value) or is_object($value)) $dimension = 2; } if($dimension == 1) $_result = array($_result); - foreach($_result as $object) + foreach($_result as $object) { foreach($keyList as $key) $result .= zget($object, $key, '') . $delimiter; } @@ -83,10 +83,10 @@ function expect($key, $delimiter = ',') /** * Import data create by zendata to one table. - * - * @param string $table - * @param string $yaml - * @param int $count + * + * @param string $table + * @param string $yaml + * @param int $count * @access public * @return void */ diff --git a/test/model/branch/getbyid.php b/test/model/branch/getbyid.php index 7ca458792f..b00216ecf6 100755 --- a/test/model/branch/getbyid.php +++ b/test/model/branch/getbyid.php @@ -1,30 +1,26 @@ #!/usr/bin/env php > `A` - 2. 使用branchID和productID获取一个存在的分支 >> `B` - 3. 使用account获取一个存在的用户 >> `` -[esac] + +使用branchID获取一个存在的分支 >> A +使用branchID和productID获取一个存在的分支 >> B +使用branchID获取一个不存在的分支 >> */ + +include dirname(dirname(__DIR__)) . '/init.php'; + $branch = $tester->loadModel('branch'); $app->dbh->query("truncate zt_product"); -zdImport(TABLE_PRODUCT, "zendata/product.yaml", 10); - $app->dbh->query("truncate zt_branch"); + +zdImport(TABLE_PRODUCT, "zendata/product.yaml", 10); zdImport(TABLE_BRANCH, "zendata/branch.yaml", 10); -/* Step 1.*/ -run($branch->getByID(1)) and expect('name'); - -/* Step 2.*/ -run($branch->getByID(2, 2)) and expect('name'); - -/* Step 3.*/ -run($branch->getByID(null)) and expect('name'); +/* Group 1. */ +run($branch->getByID(1)) and expect('name'); // Step 1.1. +run($branch->getByID(2, 2)) and expect('name'); // Step 1.2. +run($branch->getByID(null)) and expect('name'); // Step 1.3. diff --git a/test/model/trainplan/getbyid.php b/test/model/trainplan/getbyid.php index b187c6e528..0f20b2399b 100755 --- a/test/model/trainplan/getbyid.php +++ b/test/model/trainplan/getbyid.php @@ -1,15 +1,14 @@ #!/usr/bin/env php > `21,hufangzhou` -[esac] + +获取到的project是21,lecturer是hufangzhou >> `21,hufangzhou` */ +include dirname(dirname(dirname(__FILE__))) . '/init.php'; + $trainplan = $tester->loadModel('trainplan'); $app->dbh->query("truncate zt_trainplan"); diff --git a/test/zendata/trainplan.yaml b/test/zendata/trainplan.yaml index 0b22ca0ebf..cc4ceae960 100644 --- a/test/zendata/trainplan.yaml +++ b/test/zendata/trainplan.yaml @@ -4,11 +4,11 @@ author: automated export version: "1.0" fields: - field: id - range: 1-10 + range: 1-100000 - field: project - range: 21 + range: 1-100 - field: name - range: 1-10 + range: 1-100000 format: "培训计划_%d" - field: begin range: "(-1M)-(+1w):60" @@ -30,7 +30,7 @@ fields: - field: type range: outside,inside - field: status - range: wait + range: wait,done - field: summary range: ' ' - field: createdBy