-
-
Notifications
You must be signed in to change notification settings - Fork 235
/
Copy path014.phpt
32 lines (27 loc) · 754 Bytes
/
014.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--TEST--
Check for vtiful presence
--SKIPIF--
<?php if (!extension_loaded("xlswriter")) print "skip"; ?>
--FILE--
<?php
$config = ['path' => './tests'];
$excel = new \Vtiful\Kernel\Excel($config);
$freeFile = $excel->fileName("14.xlsx")
->header(['name', 'money']);
for($index = 1; $index <= 10; $index++) {
$freeFile->insertText($index, 0, 'vikin');
$freeFile->insertText($index, 1, 10);
}
$freeFile->insertText(12, 0, "Total");
$freeFile->insertFormula(12, 1, '=SUM(B2:B11)');
$freeFile->insertText(13, 0, "Total (default format)");
$freeFile->insertFormula(13, 1, '=SUM(B2:B11)', null);
$filePath = $freeFile->output();
var_dump($filePath);
?>
--CLEAN--
<?php
@unlink(__DIR__ . '/14.xlsx');
?>
--EXPECT--
string(15) "./tests/14.xlsx"