format_unlocked.phpt 728 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('format_unlocked.xlsx');
  12. $fileHandle = $fileObject->getHandle();
  13. $format = new \Vtiful\Kernel\Format($fileHandle);
  14. $unlockedStyle = $format->unlocked()->toResource();
  15. $filePath = $fileObject->header(['name', 'age'])
  16. ->data([
  17. ['wjx', 21]
  18. ])
  19. ->setRow('A2', 50, $unlockedStyle)
  20. ->protection()
  21. ->output();
  22. var_dump($filePath);
  23. ?>
  24. --CLEAN--
  25. <?php
  26. @unlink(__DIR__ . '/format_unlocked.xlsx');
  27. ?>
  28. --EXPECT--
  29. string(28) "./tests/format_unlocked.xlsx"