From a33761a20595f405b520f76496effda5d5cc071b Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 24 Sep 2025 10:13:21 +0800 Subject: [PATCH] * [misc] Enhance unit tests for convertTao::importJiraChangeItem() method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../convert/test/tao/importjirachangeitem.php | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/module/convert/test/tao/importjirachangeitem.php b/module/convert/test/tao/importjirachangeitem.php index c2102cc9ad..c109356c74 100755 --- a/module/convert/test/tao/importjirachangeitem.php +++ b/module/convert/test/tao/importjirachangeitem.php @@ -43,7 +43,7 @@ su('admin'); // 5. 创建测试实例 $convertTest = new convertTest(); -// 6. 测试步骤 - 必须包含至少5个测试步骤 +// 6. 测试步骤 - 必须包含至少8个测试步骤 r($convertTest->importJiraChangeItemTest(array())) && p() && e('true'); // 步骤1:导入空数组数据 r($convertTest->importJiraChangeItemTest(array( @@ -98,4 +98,34 @@ r($convertTest->importJiraChangeItemTest(array( 'oldstring' => 'bug', 'newstring' => 'resolved' ) -))) && p() && e('true'); // 步骤5:导入多个混合数据验证批量处理 \ No newline at end of file +))) && p() && e('true'); // 步骤5:导入多个混合数据验证批量处理 + +r($convertTest->importJiraChangeItemTest(array( + (object)array( + 'id' => 26, + 'groupid' => 1, + 'field' => '', + 'oldstring' => 'value1', + 'newstring' => 'value2' + ) +))) && p() && e('true'); // 步骤6:测试空字段名的changeitem数据 + +r($convertTest->importJiraChangeItemTest(array( + (object)array( + 'id' => 27, + 'groupid' => 1, + 'field' => 'status', + 'oldstring' => '', + 'newstring' => '' + ) +))) && p() && e('true'); // 步骤7:测试空字段值的changeitem数据 + +r($convertTest->importJiraChangeItemTest(array( + (object)array( + 'id' => 28, + 'groupid' => 1, + 'field' => 'description', + 'oldstring' => 'Bug with ', + 'newstring' => 'Fixed: Bug with "quotes" and \'apostrophes\' & special chars' + ) +))) && p() && e('true'); // 步骤8:测试特殊字符的changeitem数据 \ No newline at end of file