From 868e5f4c1df0e8ada3d9f7e4e769f9a68d27d9fb Mon Sep 17 00:00:00 2001 From: wangyuting Date: Fri, 22 Dec 2023 15:28:44 +0800 Subject: [PATCH] * Fix testreport unit test. --- module/testreport/test/model/getbugs4test.php | 1 + module/testtask/model.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/module/testreport/test/model/getbugs4test.php b/module/testreport/test/model/getbugs4test.php index 1f2c669a56..b2c1cec41d 100755 --- a/module/testreport/test/model/getbugs4test.php +++ b/module/testreport/test/model/getbugs4test.php @@ -5,6 +5,7 @@ include dirname(__FILE__, 5) . '/test/lib/init.php'; include dirname(__FILE__, 2) . '/testreport.class.php'; zdTable('bug')->config('getbugs4test_bug')->gen(40); +zdTable('testtask')->gen(0); zdTable('testtask')->gen(20); zdTable('build')->gen(10); zdTable('user')->gen(1); diff --git a/module/testtask/model.php b/module/testtask/model.php index 02b13e8ac7..1c997443c2 100755 --- a/module/testtask/model.php +++ b/module/testtask/model.php @@ -261,8 +261,8 @@ class testtaskModel extends model if(!$testtask) return false; $product = $this->dao->select('name,type')->from(TABLE_PRODUCT)->where('id')->eq($testtask->product)->fetch(); - $testtask->productName = $product->name; - $testtask->productType = $product->type; + $testtask->productName = !empty($product->name) ? $product->name : ''; + $testtask->productType = !empty($product->type) ? $product->type : ''; $testtask->branch = 0; $testtask->executionName = ''; $testtask->buildName = '';