014.phpt 666 B

123456789101112131415161718192021222324252627282930
  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. $freeFile = $excel->fileName("tutorial01.xlsx")
  10. ->header(['name', 'money']);
  11. for($index = 1; $index < 10; $index++) {
  12. $freeFile->insertText($index, 0, 'vikin');
  13. $freeFile->insertText($index, 1, 10);
  14. }
  15. $freeFile->insertText(12, 0, "Total");
  16. $freeFile->insertFormula(12, 1, '=SUM(B2:B11)');
  17. $filePath = $freeFile->output();
  18. var_dump($filePath);
  19. ?>
  20. --CLEAN--
  21. <?php
  22. @unlink(__DIR__ . '/tutorial01.xlsx');
  23. ?>
  24. --EXPECT--
  25. string(23) "./tests/tutorial01.xlsx"