format_font_size.phpt 750 B

1234567891011121314151617181920212223242526272829303132333435
  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. $fileObject = new \Vtiful\Kernel\Excel($config);
  11. $fileObject = $fileObject->fileName('format_font_size.xlsx');
  12. $fileHandle = $fileObject->getHandle();
  13. $format = new \Vtiful\Kernel\Format($fileHandle);
  14. $style = $format->fontSize(30)->toResource();
  15. $filePath = $fileObject->header(['name', 'age'])
  16. ->data([
  17. ['viest', 21],
  18. ['wjx', 21]
  19. ])
  20. ->setRow('A1', 50, $style)
  21. ->setRow('A2:A3', 50, $style)
  22. ->output();
  23. var_dump($filePath);
  24. ?>
  25. --CLEAN--
  26. <?php
  27. @unlink(__DIR__ . '/format_font_size.xlsx');
  28. ?>
  29. --EXPECT--
  30. string(29) "./tests/format_font_size.xlsx"