format_font.phpt 781 B

12345678910111213141516171819202122232425262728293031323334353637
  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('tutorial.xlsx');
  12. $fileHandle = $fileObject->getHandle();
  13. $format = new \Vtiful\Kernel\Format($fileHandle);
  14. $fontStyle = $format->font('Calibri')->toResource();
  15. // Local Test
  16. // $fontStyle = $format->font('华文楷体')->toResource();
  17. $filePath = $fileObject->header(['name', 'age'])
  18. ->data([
  19. ['viest', 21],
  20. ['wjx', 21]
  21. ])
  22. ->setRow('A1', 50, $fontStyle)
  23. ->output();
  24. var_dump($filePath);
  25. ?>
  26. --CLEAN--
  27. <?php
  28. @unlink(__DIR__ . '/tutorial.xlsx');
  29. ?>
  30. --EXPECT--
  31. string(21) "./tests/tutorial.xlsx"