open_xlsx_file.phpt 691 B

12345678910111213141516171819202122232425262728293031323334
  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');
  13. var_dump($data);
  14. ?>
  15. --CLEAN--
  16. <?php
  17. @unlink(__DIR__ . '/tutorial.xlsx');
  18. ?>
  19. --EXPECT--
  20. object(Vtiful\Kernel\Excel)#1 (4) {
  21. ["config":"Vtiful\Kernel\Excel":private]=>
  22. array(1) {
  23. ["path"]=>
  24. string(7) "./tests"
  25. }
  26. ["fileName":"Vtiful\Kernel\Excel":private]=>
  27. string(21) "./tests/tutorial.xlsx"
  28. ["handle"]=>
  29. NULL
  30. ["path"]=>
  31. NULL
  32. }