first.phpt 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --TEST--
  2. Check for vtiful presence
  3. --SKIPIF--
  4. <?php if (!extension_loaded("xlswriter")) print "skip"; ?>
  5. --FILE--
  6. <?php
  7. try {
  8. $config = ['path' => './tests'];
  9. $excel = new \Vtiful\Kernel\Excel($config);
  10. $excel->setCurrentSheetHide();
  11. } catch (\Exception $exception) {
  12. var_dump($exception->getCode());
  13. var_dump($exception->getMessage());
  14. }
  15. $config = ['path' => './tests'];
  16. $excel = new \Vtiful\Kernel\Excel($config);
  17. $excel->fileName('first.xlsx', 'sheet1')
  18. ->addSheet('sheet2')
  19. ->setCurrentSheetIsFirst()
  20. ->output();
  21. var_dump($excel);
  22. ?>
  23. --CLEAN--
  24. <?php
  25. @unlink(__DIR__ . '/first.xlsx');
  26. ?>
  27. --EXPECT--
  28. int(130)
  29. string(51) "Please create a file first, use the filename method"
  30. object(Vtiful\Kernel\Excel)#3 (3) {
  31. ["config":"Vtiful\Kernel\Excel":private]=>
  32. array(1) {
  33. ["path"]=>
  34. string(7) "./tests"
  35. }
  36. ["fileName":"Vtiful\Kernel\Excel":private]=>
  37. string(18) "./tests/first.xlsx"
  38. ["read_row_type":"Vtiful\Kernel\Excel":private]=>
  39. NULL
  40. }