viest před 5 roky
rodič
revize
84bb2810e2

+ 2 - 0
package.xml

@@ -200,6 +200,8 @@
    <file md5sum="12ff3ae17d729bbfd48c87a087544924" name="tests/sheet_add.phpt" role="test" />
    <file md5sum="98f47ea5e8aab04af809a1707a1f1476" name="tests/sheet_checkout.phpt" role="test" />
    <file md5sum="5811dd930d7b0f916c662139ff1053d4" name="tests/string_from_column_index.phpt" role="test" />
+   <file name="tests/xlsx_to_csv.phpt" role="test" />
+   <file name="tests/zoom.phpt" role="test" />
    <file md5sum="f4a2d1a28ad1bf782502d698de0b1907" name="tests/include/skipif.inc" role="test" />
    <file md5sum="bb4256831dfd81f951bd6f4afbe1719f" name="CREDITS" role="doc" />
    <file md5sum="601a053cb6f200a24303ac8d3627361c" name="README.md" role="doc" />

+ 8 - 1
tests/open_xlsx_get_data_skip_empty.phpt

@@ -40,13 +40,20 @@ var_dump($data);
 @unlink(__DIR__ . '/tutorial.xlsx');
 ?>
 --EXPECT--
-array(2) {
+array(3) {
   [0]=>
   array(1) {
     [0]=>
     string(4) "Cost"
   }
   [1]=>
+  array(2) {
+    [0]=>
+    string(0) ""
+    [1]=>
+    string(0) ""
+  }
+  [2]=>
   array(1) {
     [0]=>
     string(5) "viest"

+ 6 - 0
tests/open_xlsx_next_row_skip_empty.phpt

@@ -54,6 +54,12 @@ array(1) {
   [0]=>
   string(4) "Cost"
 }
+array(2) {
+  [0]=>
+  string(0) ""
+  [1]=>
+  string(0) ""
+}
 array(1) {
   [0]=>
   string(5) "viest"

+ 2 - 2
tests/open_xlsx_next_row_with_data_type_date_array_index.phpt

@@ -38,13 +38,13 @@ array(2) {
 }
 array(2) {
   [0]=>
-  string(5) "viest"
+  string(0) ""
   [1]=>
   string(0) ""
 }
 array(5) {
   [0]=>
-  string(0) ""
+  string(5) "viest"
   [1]=>
   string(0) ""
   [2]=>

+ 30 - 0
tests/xlsx_to_csv.phpt

@@ -0,0 +1,30 @@
+--TEST--
+Check for vtiful presence
+--SKIPIF--
+<?php if (!extension_loaded("xlswriter")) print "skip"; ?>
+--FILE--
+<?php
+$config   = ['path' => './tests'];
+$excel    = new \Vtiful\Kernel\Excel($config);
+$filePath = $excel->fileName('tutorial.xlsx', 'TestSheet1')
+    ->header(['Item', 'Cost'])
+    ->data([
+        ['Item_1', 'Cost_1', 10, 10.9999995],
+    ])
+    ->output();
+
+$fp = fopen('./tests/file.csv', 'w');
+
+$csvResult = $excel->openFile('tutorial.xlsx')
+    ->openSheet()
+    ->putCSV($fp);
+
+var_dump($csvResult);
+?>
+--CLEAN--
+<?php
+@unlink(__DIR__ . '/tutorial.xlsx');
+@unlink(__DIR__ . '/file.csv');
+?>
+--EXPECT--
+bool(true)