Browse Source

Merge pull request #16 from viest/dev

update test file
王杰新 7 years ago
parent
commit
9cf8975cf5
4 changed files with 13 additions and 8 deletions
  1. 2 2
      tests/002.phpt
  2. 2 2
      tests/003.phpt
  3. 2 2
      tests/004.phpt
  4. 7 2
      tests/005.phpt

+ 2 - 2
tests/002.phpt

@@ -4,7 +4,7 @@ Check for vtiful presence
 <?php if (!extension_loaded("excel_writer")) print "skip"; ?>
 <?php if (!extension_loaded("excel_writer")) print "skip"; ?>
 --FILE--
 --FILE--
 <?php 
 <?php 
-$config = ['path' => './tests/'];
+$config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $excel = new \Vtiful\Kernel\Excel($config);
 var_dump($excel);
 var_dump($excel);
 ?>
 ?>
@@ -13,7 +13,7 @@ object(Vtiful\Kernel\Excel)#1 (3) {
   ["config":"Vtiful\Kernel\Excel":private]=>
   ["config":"Vtiful\Kernel\Excel":private]=>
   array(1) {
   array(1) {
     ["path"]=>
     ["path"]=>
-    string(8) "./tests/"
+    string(7) "./tests"
   }
   }
   ["fileName":"Vtiful\Kernel\Excel":private]=>
   ["fileName":"Vtiful\Kernel\Excel":private]=>
   NULL
   NULL

+ 2 - 2
tests/003.phpt

@@ -4,7 +4,7 @@ Check for vtiful presence
 <?php if (!extension_loaded("excel_writer")) print "skip"; ?>
 <?php if (!extension_loaded("excel_writer")) print "skip"; ?>
 --FILE--
 --FILE--
 <?php 
 <?php 
-$config = ['path' => './tests/'];
+$config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $excel = new \Vtiful\Kernel\Excel($config);
 $fileFd = $excel->fileName('tutorial01.xlsx');
 $fileFd = $excel->fileName('tutorial01.xlsx');
 var_dump($fileFd);
 var_dump($fileFd);
@@ -14,7 +14,7 @@ object(Vtiful\Kernel\Excel)#1 (3) {
   ["config":"Vtiful\Kernel\Excel":private]=>
   ["config":"Vtiful\Kernel\Excel":private]=>
   array(1) {
   array(1) {
     ["path"]=>
     ["path"]=>
-    string(8) "./tests/"
+    string(7) "./tests"
   }
   }
   ["fileName":"Vtiful\Kernel\Excel":private]=>
   ["fileName":"Vtiful\Kernel\Excel":private]=>
   string(23) "./tests/tutorial01.xlsx"
   string(23) "./tests/tutorial01.xlsx"

+ 2 - 2
tests/004.phpt

@@ -4,7 +4,7 @@ Check for vtiful presence
 <?php if (!extension_loaded("excel_writer")) print "skip"; ?>
 <?php if (!extension_loaded("excel_writer")) print "skip"; ?>
 --FILE--
 --FILE--
 <?php 
 <?php 
-$config = ['path' => './tests/'];
+$config = ['path' => './tests'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $excel = new \Vtiful\Kernel\Excel($config);
 $fileFd = $excel->fileName('tutorial01.xlsx');
 $fileFd = $excel->fileName('tutorial01.xlsx');
 $setHeader = $fileFd->header(['Item', 'Cost']);
 $setHeader = $fileFd->header(['Item', 'Cost']);
@@ -15,7 +15,7 @@ object(Vtiful\Kernel\Excel)#1 (3) {
   ["config":"Vtiful\Kernel\Excel":private]=>
   ["config":"Vtiful\Kernel\Excel":private]=>
   array(1) {
   array(1) {
     ["path"]=>
     ["path"]=>
-    string(8) "./tests/"
+    string(7) "./tests"
   }
   }
   ["fileName":"Vtiful\Kernel\Excel":private]=>
   ["fileName":"Vtiful\Kernel\Excel":private]=>
   string(23) "./tests/tutorial01.xlsx"
   string(23) "./tests/tutorial01.xlsx"

+ 7 - 2
tests/005.phpt

@@ -4,7 +4,12 @@ Check for vtiful presence
 <?php if (!extension_loaded("excel_writer")) print "skip"; ?>
 <?php if (!extension_loaded("excel_writer")) print "skip"; ?>
 --FILE--
 --FILE--
 <?php 
 <?php 
-echo "output path";
+$config = ['path' => './tests'];
+$excel = new \Vtiful\Kernel\Excel($config);
+$filePath = $excel->fileName('tutorial01.xlsx')
+    ->header(['Item', 'Cost'])
+    ->output();
+var_dump($filePath);
 ?>
 ?>
 --EXPECT--
 --EXPECT--
-output path
+string(23) "./tests/tutorial01.xlsx"