From 3cc59b0e3edb147d118ca2b2fa0de7c41d2ad5af Mon Sep 17 00:00:00 2001 From: liugang Date: Wed, 24 Sep 2025 07:12:50 +0800 Subject: [PATCH] * [misc] Enhance unit tests for pivotModel::pureCrystalData() 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 --- module/pivot/test/model/purecrystaldata.php | 36 ++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/module/pivot/test/model/purecrystaldata.php b/module/pivot/test/model/purecrystaldata.php index 6cd3d38e23..7fdee2460e 100755 --- a/module/pivot/test/model/purecrystaldata.php +++ b/module/pivot/test/model/purecrystaldata.php @@ -108,4 +108,38 @@ r($pivotTest->pureCrystalDataTest(array( ), 'groups' => array('type' => 'comprehensive', 'status' => 'active') ) -))) && p('0:type,col1:value,col2_part1:value,col2:total,col3:value') && e('comprehensive,100,50,110,200'); \ No newline at end of file +))) && p('0:type,col1:value,col2_part1:value,col2:total,col3:value') && e('comprehensive,100,50,110,200'); + +r($pivotTest->pureCrystalDataTest(array( + 0 => array( + 'columns' => array( + 'col1' => array( + 'cellData' => array() + ) + ), + 'groups' => array('empty' => 'test') + ) +))) && p('0:empty') && e('test'); + +r($pivotTest->pureCrystalDataTest(array( + 0 => array( + 'columns' => array( + 'col1' => array( + 'cellData' => array( + 'slice1' => array('label' => 'NoValue'), + 'slice2' => array('count' => 5) + ) + ) + ), + 'groups' => array('missing' => 'value') + ) +))) && p('0:col1_slice1:label,col1_slice2:count') && e('NoValue,5'); + +r($pivotTest->pureCrystalDataTest(array_fill(0, 50, array( + 'columns' => array( + 'metric' => array( + 'cellData' => array('value' => 10) + ) + ), + 'groups' => array('batch' => 'data') +)))) && p() && e('50'); \ No newline at end of file