Skip to content

Commit 5176a92

Browse files
committed
Test: read cell by callback
1 parent 62809c2 commit 5176a92

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ notifications:
2929
before_script:
3030
- git submodule update --init
3131
- sudo apt-get install zlib1g-dev -y
32-
- phpize && ./configure && make clean && make
32+
- phpize && ./configure --enable-reader && make clean && make
3333

3434
branches:
3535
only:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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('tutorial.xlsx')
13+
->header(['Item', 'Cost'])
14+
->data([
15+
['Item_1', 'Cost_1'],
16+
])
17+
->output();
18+
19+
$excel->openFile('tutorial.xlsx')->nextCellCallback(function ($row, $cell, $data) {
20+
echo 'cell:' . $cell . ', row:' . $row . ', value:' . $data . PHP_EOL;
21+
});
22+
?>
23+
--CLEAN--
24+
<?php
25+
@unlink(__DIR__ . '/tutorial.xlsx');
26+
?>
27+
--EXPECT--
28+
cell:1, row:1, value:Item
29+
cell:2, row:1, value:Cost
30+
cell:2, row:1, value:XLSX_ROW_END
31+
cell:1, row:2, value:Item_1
32+
cell:2, row:2, value:Cost_1
33+
cell:2, row:2, value:XLSX_ROW_END

0 commit comments

Comments
 (0)