013.phpt 591 B

123456789101112131415161718192021222324252627
  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. $textFile = $excel->fileName("tutorial01.xlsx")
  10. ->header(['name', 'age']);
  11. for ($index = 0; $index < 10; $index++) {
  12. $textFile->insertText($index+1, 0, 'vikin');
  13. $textFile->insertText($index+1, 1, 1000, '#,##0');
  14. }
  15. $filePath = $textFile->output();
  16. var_dump($filePath);
  17. ?>
  18. --CLEAN--
  19. <?php
  20. @unlink(__DIR__ . '/tutorial01.xlsx');
  21. ?>
  22. --EXPECT--
  23. string(23) "./tests/tutorial01.xlsx"