Skip to content

Commit ee8bdb6

Browse files
committed
TEST: Incremental Write
1 parent bf55d68 commit ee8bdb6

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

kernel/excel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ PHP_METHOD(vtiful_xls, fileName)
155155

156156
ZEND_PARSE_PARAMETERS_START(1, 2)
157157
Z_PARAM_STR(zs_file_name)
158+
Z_PARAM_OPTIONAL
158159
Z_PARAM_STR(zs_sheet_name)
159160
ZEND_PARSE_PARAMETERS_END();
160161

tests/018.phpt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
Check for vtiful presence
3+
--SKIPIF--
4+
<?php if (!extension_loaded("xlswriter")) print "skip"; ?>
5+
--FILE--
6+
<?php
7+
$config = ['path' => './tests'];
8+
$excel = new \Vtiful\Kernel\Excel($config);
9+
10+
$fileObject = $excel->fileName("tutorial01.xlsx");
11+
12+
$fileObject->header(['name', 'age'])
13+
->data([['viest', 21]])
14+
->data([['wjx', 21]]);
15+
16+
$filePath = $fileObject->output();
17+
18+
var_dump($filePath);
19+
?>
20+
--CLEAN--
21+
<?php
22+
@unlink(__DIR__ . '/tutorial01.xlsx');
23+
?>
24+
--EXPECT--
25+
string(23) "./tests/tutorial01.xlsx"

0 commit comments

Comments
 (0)