insert_date_resource_format.phpt 757 B

123456789101112131415161718192021222324252627282930
  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_date_resource_format.xlsx');
  12. $fileHandle = $fileObject->getHandle();
  13. $format = new \Vtiful\Kernel\Format($fileHandle);
  14. $colorStyle = $format->fontColor(\Vtiful\Kernel\Format::COLOR_ORANGE)->toResource();
  15. $filePath = $fileObject->header(['date'])
  16. ->insertDate(1, 0, time(), 'mmm d yyyy hh:mm AM/PM', $colorStyle)
  17. ->output();
  18. var_dump($filePath);
  19. ?>
  20. --CLEAN--
  21. <?php
  22. @unlink(__DIR__ . '/insert_date_resource_format.xlsx');
  23. ?>
  24. --EXPECT--
  25. string(40) "./tests/insert_date_resource_format.xlsx"