fix-243.phpt 804 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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('fix-243.xlsx')
  13. ->header(['NumberToString', 'Number'])
  14. ->data([
  15. ['01234567', '01234567']
  16. ])
  17. ->output();
  18. $data = $excel->openFile('fix-243.xlsx')
  19. ->openSheet()
  20. ->setType([
  21. \Vtiful\Kernel\Excel::TYPE_STRING,
  22. ])
  23. ->getSheetData();
  24. var_dump($data);
  25. ?>
  26. --CLEAN--
  27. <?php
  28. @unlink(__DIR__ . '/fix-243.xlsx');
  29. ?>
  30. --EXPECT--
  31. array(2) {
  32. [0]=>
  33. array(2) {
  34. [0]=>
  35. string(14) "NumberToString"
  36. [1]=>
  37. string(6) "Number"
  38. }
  39. [1]=>
  40. array(2) {
  41. [0]=>
  42. string(8) "01234567"
  43. [1]=>
  44. int(1234567)
  45. }
  46. }