+ Move unit test from test directory to each module.

This commit is contained in:
zhouxin
2023-04-24 02:16:47 +00:00
parent 8b32e6592a
commit 4efea42989
1671 changed files with 83077 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env php
<?php
include dirname(__FILE__, 5) . "/test/lib/init.php";
include dirname(__FILE__, 2) . '/project.class.php';
su('admin');
/**
title=测试 projectModel->updateProductProgram();
cid=1
pid=1
查看被更新了项目集的产品数量 >> 4
查看被更新了项目集的产品详情 >> 1,正常产品1
查看被更新了项目集的产品详情 >> 1,正常产品2
查看被更新了项目集的产品详情 >> 1,正常产品3
查看被更新了项目集的产品详情 >> 1,正常产品4
*/
global $tester;
$tester->loadModel('project');
$productIdList = array(1, 2, 3, 4);
$tester->project->updateProductProgram(7, 1, $productIdList);
$products = $tester->loadModel('product')->getByIdList($productIdList);
r(count($products)) && p('') && e('4'); // 查看被更新了项目集的产品数量
r($products) && p('1:program,name') && e('1,正常产品1'); // 查看被更新了项目集的产品详情
r($products) && p('2:program,name') && e('1,正常产品2'); // 查看被更新了项目集的产品详情
r($products) && p('3:program,name') && e('1,正常产品3'); // 查看被更新了项目集的产品详情
r($products) && p('4:program,name') && e('1,正常产品4'); // 查看被更新了项目集的产品详情