header_format.phpt 728 B

123456789101112131415161718192021222324252627282930313233
  1. --TEST--
  2. Check for vtiful presence
  3. --SKIPIF--
  4. <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. $config = [
  8. 'path' => './tests'
  9. ];
  10. $excel = new \Vtiful\Kernel\Excel($config);
  11. $fileObject = $excel->fileName('header_format.xlsx');
  12. $fileHandle = $fileObject->getHandle();
  13. $format = new \Vtiful\Kernel\Format($fileHandle);
  14. $alignStyle = $format->align(
  15. \Vtiful\Kernel\Format::FORMAT_ALIGN_CENTER,
  16. \Vtiful\Kernel\Format::FORMAT_ALIGN_VERTICAL_CENTER
  17. )->toResource();
  18. $setHeader = $fileObject
  19. ->header(['Item', 'Cost'], $alignStyle)
  20. ->output();
  21. var_dump($setHeader);
  22. ?>
  23. --CLEAN--
  24. <?php
  25. @unlink(__DIR__ . '/header_format.xlsx');
  26. ?>
  27. --EXPECT--
  28. string(26) "./tests/header_format.xlsx"