open_xlsx_get_data_skip_hidden_rows.phpt 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --TEST--
  2. Check for vtiful presence
  3. --SKIPIF--
  4. <?php
  5. require __DIR__ . '/include/skipif.inc';
  6. skip_disable_reader();
  7. ?>
  8. --FILE--
  9. <?php
  10. $config = ['path' => './tests/xlsx'];
  11. $excel = new \Vtiful\Kernel\Excel($config);
  12. $data = $excel->openFile('hidden_row.xlsx')
  13. ->openSheet('Sheet1')
  14. ->getSheetData();
  15. var_dump($data);
  16. $data = $excel->openFile('hidden_row.xlsx')
  17. ->openSheet('Sheet1', \Vtiful\Kernel\Excel::SKIP_HIDDEN_ROW|\Vtiful\Kernel\Excel::SKIP_EMPTY_ROW)
  18. ->getSheetData();
  19. var_dump($data);
  20. ?>
  21. --EXPECT--
  22. array(4) {
  23. [0]=>
  24. array(1) {
  25. [0]=>
  26. string(4) "name"
  27. }
  28. [1]=>
  29. array(1) {
  30. [0]=>
  31. string(8) "ZhangSan"
  32. }
  33. [2]=>
  34. array(1) {
  35. [0]=>
  36. string(4) "LiSi"
  37. }
  38. [3]=>
  39. array(1) {
  40. [0]=>
  41. string(6) "WangWu"
  42. }
  43. }
  44. array(2) {
  45. [0]=>
  46. array(1) {
  47. [0]=>
  48. string(4) "name"
  49. }
  50. [1]=>
  51. array(1) {
  52. [0]=>
  53. string(6) "WangWu"
  54. }
  55. }