margins.phpt 615 B

12345678910111213141516171819202122232425262728293031
  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('margins.xlsx');
  12. $filePath = $fileObject->header(['name', 'age'])
  13. ->data([
  14. ['viest', 21],
  15. ['wjx', 21]
  16. ])
  17. ->setPaper(\Vtiful\Kernel\Excel::PAPER_A3)
  18. ->setLandscape()
  19. ->setMargins(1, 1, 2, 2)
  20. ->output();
  21. var_dump($filePath);
  22. ?>
  23. --CLEAN--
  24. <?php
  25. @unlink(__DIR__ . '/margins.xlsx');
  26. ?>
  27. --EXPECT--
  28. string(20) "./tests/margins.xlsx"