#!/usr/bin/env php 10, 'percentage' => array('', '', '', '', 'col1')), array('value' => 20, 'percentage' => array('', '', '', '', 'col2')), array('value' => 15, 'percentage' => array('', '', '', '', 'col1')) ); r($pivotTest->getRowTotalTest($normalRow)) && p('col1') && e(25); // 测试步骤2:包含多个相同列键的单元格 $multiSameKeyRow = array( array('value' => 30, 'percentage' => array('', '', '', '', 'col1')), array('value' => 40, 'percentage' => array('', '', '', '', 'col1')), array('value' => 50, 'percentage' => array('', '', '', '', 'col2')) ); r($pivotTest->getRowTotalTest($multiSameKeyRow)) && p('col1,col2') && e('70,50'); // 测试步骤3:不包含percentage信息的单元格 $noPercentageRow = array( array('value' => 10), array('value' => 20, 'percentage' => array('', '', '', '', 'col1')), array('value' => 30) ); r($pivotTest->getRowTotalTest($noPercentageRow)) && p('col1') && e(20); // 测试步骤4:包含不同列键的复杂数据 $complexRow = array( array('value' => 100, 'percentage' => array('', '', '', '', 'col1')), array('value' => 200, 'percentage' => array('', '', '', '', 'col2')), array('value' => 300, 'percentage' => array('', '', '', '', 'col3')), array('value' => 150, 'percentage' => array('', '', '', '', 'col1')), array('value' => 250, 'percentage' => array('', '', '', '', 'col2')) ); r($pivotTest->getRowTotalTest($complexRow)) && p('col1,col2,col3') && e('250,450,300'); // 测试步骤5:空行数据 $emptyRow = array(); r($pivotTest->getRowTotalTest($emptyRow)) && p() && e(0);