open_xlsx_file.phpt 746 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_file.xlsx')
  13. ->header(['Item', 'Cost'])
  14. ->output();
  15. $data = $excel->openFile('open_xlsx_file.xlsx');
  16. var_dump($data);
  17. ?>
  18. --CLEAN--
  19. <?php
  20. @unlink(__DIR__ . '/open_xlsx_file.xlsx');
  21. ?>
  22. --EXPECT--
  23. object(Vtiful\Kernel\Excel)#1 (3) {
  24. ["config":"Vtiful\Kernel\Excel":private]=>
  25. array(1) {
  26. ["path"]=>
  27. string(7) "./tests"
  28. }
  29. ["fileName":"Vtiful\Kernel\Excel":private]=>
  30. string(27) "./tests/open_xlsx_file.xlsx"
  31. ["read_row_type":"Vtiful\Kernel\Excel":private]=>
  32. NULL
  33. }