012.phpt 701 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Check for vtiful presence
  3. --SKIPIF--
  4. <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. $config = ['path' => './tests'];
  8. $excel = new \Vtiful\Kernel\Excel($config);
  9. $fileObject = $excel->fileName('12.xlsx');
  10. $fileHandle = $fileObject->getHandle();
  11. $format = new \Vtiful\Kernel\Format($fileHandle);
  12. $boldStyle = $format->bold()->toResource();
  13. $filePath = $fileObject->header(['name', 'age'])
  14. ->data([
  15. ['viest', 21],
  16. ['wjx', 21]
  17. ])
  18. ->setRow('A1', 200, $boldStyle)
  19. ->setRow('A2:A3', 200, $boldStyle)
  20. ->output();
  21. var_dump($filePath);
  22. ?>
  23. --CLEAN--
  24. <?php
  25. @unlink(__DIR__ . '/12.xlsx');
  26. ?>
  27. --EXPECT--
  28. string(15) "./tests/12.xlsx"