123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- --TEST--
- Check for vtiful presence
- --SKIPIF--
- <?php
- require __DIR__ . '/include/skipif.inc';
- skip_disable_reader();
- ?>
- --FILE--
- <?php
- $config = ['path' => './tests'];
- $excel = new \Vtiful\Kernel\Excel($config);
- $filePath = $excel->fileName('tutorial.xlsx')
- ->header(['', 'Cost'])
- ->data([
- [],
- ['viest', '']
- ])
- ->output();
- $data = $excel->openFile('tutorial.xlsx')
- ->openSheet('Sheet1', \Vtiful\Kernel\Excel::SKIP_EMPTY_CELLS)
- ->getSheetData();
- var_dump($data);
- $data = $excel->openFile('tutorial.xlsx')
- ->openSheet('Sheet1', \Vtiful\Kernel\Excel::SKIP_EMPTY_ROW)
- ->getSheetData();
- var_dump($data);
- $data = $excel->openFile('tutorial.xlsx')
- ->openSheet('Sheet1', \Vtiful\Kernel\Excel::SKIP_EMPTY_CELLS|\Vtiful\Kernel\Excel::SKIP_EMPTY_ROW)
- ->getSheetData();
- var_dump($data);
- $data = $excel->openFile('tutorial.xlsx')
- ->openSheet('Sheet1', \Vtiful\Kernel\Excel::SKIP_EMPTY_VALUE)
- ->getSheetData();
- var_dump($data);
- ?>
- --CLEAN--
- <?php
- @unlink(__DIR__ . '/tutorial.xlsx');
- ?>
- --EXPECT--
- array(3) {
- [0]=>
- array(1) {
- [1]=>
- string(4) "Cost"
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(1) {
- [0]=>
- string(5) "viest"
- }
- }
- array(2) {
- [0]=>
- array(2) {
- [0]=>
- string(0) ""
- [1]=>
- string(4) "Cost"
- }
- [1]=>
- array(2) {
- [0]=>
- string(5) "viest"
- [1]=>
- string(0) ""
- }
- }
- array(2) {
- [0]=>
- array(1) {
- [1]=>
- string(4) "Cost"
- }
- [1]=>
- array(1) {
- [0]=>
- string(5) "viest"
- }
- }
- array(3) {
- [0]=>
- array(1) {
- [1]=>
- string(4) "Cost"
- }
- [1]=>
- array(0) {
- }
- [2]=>
- array(1) {
- [0]=>
- string(5) "viest"
- }
- }
|