open_xlsx_next_row.phpt 879 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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'];
  11. $excel = new \Vtiful\Kernel\Excel($config);
  12. $filePath = $excel->fileName('open_xlsx_next_row.xlsx')
  13. ->header(['Item', 'Cost'])
  14. ->data([
  15. ['Item_1', 'Cost_1'],
  16. ])
  17. ->output();
  18. $excel->openFile('open_xlsx_next_row.xlsx')
  19. ->openSheet();
  20. var_dump($excel->nextRow());
  21. var_dump($excel->nextRow());
  22. var_dump($excel->nextRow());
  23. var_dump($excel->nextRow());
  24. var_dump($excel->nextRow());
  25. var_dump($excel->nextRow());
  26. var_dump($excel->nextRow());
  27. ?>
  28. --CLEAN--
  29. <?php
  30. @unlink(__DIR__ . '/open_xlsx_next_row.xlsx');
  31. ?>
  32. --EXPECT--
  33. array(2) {
  34. [0]=>
  35. string(4) "Item"
  36. [1]=>
  37. string(4) "Cost"
  38. }
  39. array(2) {
  40. [0]=>
  41. string(6) "Item_1"
  42. [1]=>
  43. string(6) "Cost_1"
  44. }
  45. NULL
  46. NULL
  47. NULL
  48. NULL
  49. NULL