fix-207.phpt 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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-207.xlsx')
  13. ->header(['Name', 'Code'])
  14. ->data([
  15. ['Viest', '00024']
  16. ])
  17. ->output();
  18. $dataOne = $excel->openFile('fix-207.xlsx')
  19. ->openSheet()
  20. ->setType([
  21. \Vtiful\Kernel\Excel::TYPE_STRING,
  22. \Vtiful\Kernel\Excel::TYPE_STRING,
  23. ])
  24. ->getSheetData();
  25. $dataTwo = $excel->openFile('fix-207.xlsx')
  26. ->openSheet()
  27. ->setType([
  28. \Vtiful\Kernel\Excel::TYPE_STRING,
  29. \Vtiful\Kernel\Excel::TYPE_INT,
  30. ])
  31. ->getSheetData();
  32. var_dump($dataOne);
  33. var_dump($dataTwo);
  34. ?>
  35. --CLEAN--
  36. <?php
  37. @unlink(__DIR__ . '/fix-207.xlsx');
  38. ?>
  39. --EXPECT--
  40. array(2) {
  41. [0]=>
  42. array(2) {
  43. [0]=>
  44. string(4) "Name"
  45. [1]=>
  46. string(4) "Code"
  47. }
  48. [1]=>
  49. array(2) {
  50. [0]=>
  51. string(5) "Viest"
  52. [1]=>
  53. string(5) "00024"
  54. }
  55. }
  56. array(2) {
  57. [0]=>
  58. array(2) {
  59. [0]=>
  60. string(4) "Name"
  61. [1]=>
  62. string(4) "Code"
  63. }
  64. [1]=>
  65. array(2) {
  66. [0]=>
  67. string(5) "Viest"
  68. [1]=>
  69. int(24)
  70. }
  71. }