format_color.phpt 735 B

12345678910111213141516171819202122232425262728293031323334
  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. $colorStyle = $format->color(\Vtiful\Kernel\Format::COLOR_ORANGE)->toResource();
  15. $filePath = $fileObject->header(['name', 'age'])
  16. ->data([
  17. ['viest', 21],
  18. ['wjx', 21]
  19. ])
  20. ->setRow('A1', 50, $colorStyle)
  21. ->output();
  22. var_dump($filePath);
  23. ?>
  24. --CLEAN--
  25. <?php
  26. @unlink(__DIR__ . '/tutorial.xlsx');
  27. ?>
  28. --EXPECT--
  29. string(21) "./tests/tutorial.xlsx"