+ [misc] add unit test case:parseSqlTest.

This commit is contained in:
qixinzhi
2024-06-11 06:32:27 +00:00
parent aa43e57f91
commit 9bf945e489
+12 -1
View File
@@ -52,7 +52,18 @@ WHERE 1 = (
)
EOT;
$sqls[3] = <<<EOT
SELECT DISTINCT id,estimate hour
FROM zt_story t1
WHERE 1 = (
SELECT COUNT(DISTINCT id,estimate)
FROM zt_story t2
WHERE t2.estimate> t1.estimate
)
EOT;
$bi=new biTest();
r($bi->parseSqlTest($sqls[0])) && p('id,name,bugID,type,fixedBugs,caseTitle') && e('zt_product=>id,zt_product=>name,zt_bug=>id,zt_bug=>type,zt_product=>fixedBugs,zt_case=>title'); // 测试第1条sql
r($bi->parseSqlTest($sqls[1])) && p('id,name,consumed') && e('zt_task=>id,zt_task=>name,zt_task=>consumed'); // 测试第2条sql
r($bi->parseSqlTest($sqls[2])) && p('id,estimate') && e('zt_story=>id,zt_story=>estimate'); // 测试第3条sql
r($bi->parseSqlTest($sqls[2])) && p('id,estimate') && e('zt_story=>id,zt_story=>estimate'); // 测试第3条sql
r($bi->parseSqlTest($sqls[3])) && p('id,hour') && e('zt_story=>id,zt_story=>estimate'); // 测试第4条sql