소스 검색

add: tests

shine 7 년 전
부모
커밋
74a8faea12
6개의 변경된 파일48개의 추가작업 그리고 11개의 파일을 삭제
  1. 1 2
      .travis.yml
  2. 0 1
      excel.php
  3. 14 2
      tests/002.phpt
  4. 15 2
      tests/003.phpt
  5. 16 2
      tests/004.phpt
  6. 2 2
      tests/005.phpt

+ 1 - 2
.travis.yml

@@ -24,6 +24,5 @@ branches:
   only:
   only:
     - master
     - master
     - dev
     - dev
-
 script:
 script:
-  - exit 0
+    - ./travis/run-test.sh

+ 0 - 1
excel.php

@@ -1,7 +1,6 @@
 <?php
 <?php
 $config = ['path' => './tests/'];
 $config = ['path' => './tests/'];
 $excel = new \Vtiful\Kernel\Excel($config);
 $excel = new \Vtiful\Kernel\Excel($config);
-var_dump($excel);
 $fileFd = $excel->fileName('tutorial01.xlsx');
 $fileFd = $excel->fileName('tutorial01.xlsx');
 var_dump($fileFd);
 var_dump($fileFd);
 $setHeader = $fileFd->header(['Item', 'Cost']);
 $setHeader = $fileFd->header(['Item', 'Cost']);

+ 14 - 2
tests/002.phpt

@@ -4,7 +4,19 @@ 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 "vtiful extension is available";
+$config = ['path' => './tests/'];
+$excel = new \Vtiful\Kernel\Excel($config);
+var_dump($excel);
 ?>
 ?>
 --EXPECT--
 --EXPECT--
-vtiful extension is available
+object(Vtiful\Kernel\Excel)#1 (3) {
+  ["config":"Vtiful\Kernel\Excel":private]=>
+  array(1) {
+    ["path"]=>
+    string(8) "./tests/"
+  }
+  ["fileName":"Vtiful\Kernel\Excel":private]=>
+  NULL
+  ["handle":"Vtiful\Kernel\Excel":private]=>
+  NULL
+}

+ 15 - 2
tests/003.phpt

@@ -4,7 +4,20 @@ 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 "vtiful extension is available";
+$config = ['path' => './tests/'];
+$excel = new \Vtiful\Kernel\Excel($config);
+$fileFd = $excel->fileName('tutorial01.xlsx');
+var_dump($fileFd);
 ?>
 ?>
 --EXPECT--
 --EXPECT--
-vtiful extension is available
+object(Vtiful\Kernel\Excel)#1 (3) {
+  ["config":"Vtiful\Kernel\Excel":private]=>
+  array(1) {
+    ["path"]=>
+    string(8) "./tests/"
+  }
+  ["fileName":"Vtiful\Kernel\Excel":private]=>
+  string(23) "./tests/tutorial01.xlsx"
+  ["handle":"Vtiful\Kernel\Excel":private]=>
+  resource(4) of type (vtiful)
+}

+ 16 - 2
tests/004.phpt

@@ -4,7 +4,21 @@ 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 "vtiful extension is available";
+$config = ['path' => './tests/'];
+$excel = new \Vtiful\Kernel\Excel($config);
+$fileFd = $excel->fileName('tutorial01.xlsx');
+$setHeader = $fileFd->header(['Item', 'Cost']);
+var_dump($setHeader);
 ?>
 ?>
 --EXPECT--
 --EXPECT--
-vtiful extension is available
+object(Vtiful\Kernel\Excel)#1 (3) {
+  ["config":"Vtiful\Kernel\Excel":private]=>
+  array(1) {
+    ["path"]=>
+    string(8) "./tests/"
+  }
+  ["fileName":"Vtiful\Kernel\Excel":private]=>
+  string(23) "./tests/tutorial01.xlsx"
+  ["handle":"Vtiful\Kernel\Excel":private]=>
+  resource(5) of type (vtiful)
+}

+ 2 - 2
tests/005.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 
-echo "vtiful extension is available";
+echo "output path";
 ?>
 ?>
 --EXPECT--
 --EXPECT--
-vtiful extension is available
+output path