open_xlsx_get_data.phpt 609 B

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