open_xlsx_get_data.phpt 569 B

123456789101112131415161718192021222324252627282930313233
  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('tutorial.xlsx')
  13. ->header(['Item', 'Cost'])
  14. ->output();
  15. $data = $excel->openFile('tutorial.xlsx')->openSheet()->getSheetData();
  16. var_dump($data);
  17. ?>
  18. --CLEAN--
  19. <?php
  20. @unlink(__DIR__ . '/tutorial.xlsx');
  21. ?>
  22. --EXPECT--
  23. array(1) {
  24. [0]=>
  25. array(2) {
  26. [0]=>
  27. string(4) "Item"
  28. [1]=>
  29. string(4) "Cost"
  30. }
  31. }