011.phpt 629 B

12345678910111213141516171819202122232425262728
  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('11.xlsx');
  10. $fileHandle = $fileObject->getHandle();
  11. $format = new \Vtiful\Kernel\Format($fileHandle);
  12. $boldStyle = $format->bold()->toResource();
  13. $filePath = $fileObject->header(['name', 'age'])
  14. ->data([['viest', 21]])
  15. ->setColumn('A:A', 200, $boldStyle)
  16. ->output();
  17. var_dump($filePath);
  18. ?>
  19. --CLEAN--
  20. <?php
  21. @unlink(__DIR__ . '/11.xlsx');
  22. ?>
  23. --EXPECT--
  24. string(15) "./tests/11.xlsx"