* adjust version and adjust test.

This commit is contained in:
wangyidong
2021-06-04 12:10:48 +08:00
parent 3cc93bd722
commit f6594c7022
7 changed files with 36 additions and 45 deletions
+1 -1
View File
@@ -1 +1 @@
15.1
15.0.1
+1 -1
View File
@@ -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.
-4
View File
@@ -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')
+13 -13
View File
@@ -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
*/
+13 -17
View File
@@ -1,30 +1,26 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/init.php';
/**
[case]
title=测试 branchModel::getById();
cid=1
pid=1
[group]
1. 使用branchID获取一个存在的分支 >> `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.
+4 -5
View File
@@ -1,15 +1,14 @@
#!/usr/bin/env php
<?php
include dirname(dirname(dirname(__FILE__))) . '/init.php';
/**
[case]
title=测试 trainplanModel::getById();
cid=1
pid=1
[group]
1. 获取到的project是21,lecturer是hufangzhou >> `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");
+4 -4
View File
@@ -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