insert_url_format.phpt 863 B

123456789101112131415161718192021222324252627282930313233343536
  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('insert_url_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. $filePath = $fileObject->header(['name', 'age'])
  19. ->data([
  20. ['viest', 21],
  21. ['wjx', 21]
  22. ])
  23. ->insertUrl(3, 0, 'https://github.com', NULL, NULL, $alignStyle)
  24. ->output();
  25. var_dump($filePath);
  26. ?>
  27. --CLEAN--
  28. <?php
  29. @unlink(__DIR__ . '/insert_url_format.xlsx');
  30. ?>
  31. --EXPECT--
  32. string(30) "./tests/insert_url_format.xlsx"