header_format.phpt 657 B

1234567891011121314151617181920212223242526272829
  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('tutorial.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. --EXPECT--
  24. string(21) "./tests/tutorial.xlsx"