open_xlsx_get_data.phpt 555 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Check for vtiful presence
  3. --SKIPIF--
  4. <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. $config = ['path' => './tests'];
  8. $excel = new \Vtiful\Kernel\Excel($config);
  9. $filePath = $excel->fileName('tutorial.xlsx')
  10. ->header(['Item', 'Cost'])
  11. ->output();
  12. $data = $excel->openFile('tutorial.xlsx')->openSheet()->getSheetData();
  13. var_dump($data);
  14. ?>
  15. --CLEAN--
  16. <?php
  17. @unlink(__DIR__ . '/tutorial.xlsx');
  18. ?>
  19. --EXPECT--
  20. array(1) {
  21. [0]=>
  22. array(2) {
  23. [0]=>
  24. string(4) "Item"
  25. [1]=>
  26. string(4) "Cost"
  27. }
  28. }