File tree Expand file tree Collapse file tree 2 files changed +76
-1
lines changed Expand file tree Collapse file tree 2 files changed +76
-1
lines changed Original file line number Diff line number Diff line change 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+
13+ $ filePath = $ excel ->fileName ('tutorial.xlsx ' )
14+ ->header (['Name ' , 'Code ' ])
15+ ->data ([
16+ ['Viest ' , '00024 ' ]
17+ ])
18+ ->output ();
19+
20+ $ dataOne = $ excel ->openFile ('tutorial.xlsx ' )
21+ ->openSheet ()
22+ ->setType ([
23+ \Vtiful \Kernel \Excel::TYPE_STRING ,
24+ \Vtiful \Kernel \Excel::TYPE_STRING ,
25+ ])
26+ ->getSheetData ();
27+
28+ $ dataTwo = $ excel ->openFile ('tutorial.xlsx ' )
29+ ->openSheet ()
30+ ->setType ([
31+ \Vtiful \Kernel \Excel::TYPE_STRING ,
32+ \Vtiful \Kernel \Excel::TYPE_INT ,
33+ ])
34+ ->getSheetData ();
35+
36+ var_dump ($ dataOne );
37+ var_dump ($ dataTwo );
38+ ?>
39+ --CLEAN--
40+ <?php
41+ @unlink (__DIR__ . '/tutorial.xlsx ' );
42+ ?>
43+ --EXPECT--
44+ array(2) {
45+ [0]=>
46+ array(2) {
47+ [0]=>
48+ string(4) "Name"
49+ [1]=>
50+ string(4) "Code"
51+ }
52+ [1]=>
53+ array(2) {
54+ [0]=>
55+ string(5) "Viest"
56+ [1]=>
57+ string(5) "00024"
58+ }
59+ }
60+ array(2) {
61+ [0]=>
62+ array(2) {
63+ [0]=>
64+ string(4) "Name"
65+ [1]=>
66+ string(4) "Code"
67+ }
68+ [1]=>
69+ array(2) {
70+ [0]=>
71+ string(5) "Viest"
72+ [1]=>
73+ int(24)
74+ }
75+ }
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ array(2) {
4848 [0]=>
4949 string(5) "Viest"
5050 [1]=>
51- int(24)
51+ string(2) "24"
5252 [2]=>
5353 int(1568877706)
5454 }
You can’t perform that action at this time.
0 commit comments