012.phpt 683 B

12345678910111213141516171819202122232425262728293031
  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. $fileObject = $excel->fileName('tutorial01.xlsx');
  10. $fileHandle = $fileObject->getHandle();
  11. $boldStyle = \Vtiful\Kernel\Format::bold($fileHandle);
  12. $filePath = $fileObject->header(['name', 'age'])
  13. ->data([
  14. ['viest', 21],
  15. ['wjx', 21]
  16. ])
  17. ->setRow('A1', 200, $boldStyle)
  18. ->setRow('A2:A3', 200, $boldStyle)
  19. ->output();
  20. var_dump($filePath);
  21. ?>
  22. --CLEAN--
  23. <?php
  24. @unlink(__DIR__ . '/tutorial01.xlsx');
  25. ?>
  26. --EXPECT--
  27. string(23) "./tests/tutorial01.xlsx"