]> granicus.if.org Git - php/commitdiff
Improve test environment, fix 001.phpt and rename that one, also change from /tmp...
authorMarcus Boerger <helly@php.net>
Fri, 18 Apr 2003 20:53:18 +0000 (20:53 +0000)
committerMarcus Boerger <helly@php.net>
Fri, 18 Apr 2003 20:53:18 +0000 (20:53 +0000)
ext/sqlite/tests/blankdb.inc
ext/sqlite/tests/sqlite_001.phpt
ext/sqlite/tests/sqlite_002.phpt [moved from ext/sqlite/tests/001.phpt with 98% similarity, mode: 0755]

index 45d9753ba87342d77630584b104b0edd0d489d30..085d3b2b5112b5f15ce4fe106703cd70e9daf3c6 100644 (file)
@@ -1,7 +1,9 @@
 <?php #vim:ft=php
-$dbname = tempnam("/tmp", "phpsql");
+$dbname = tempnam(dirname(__FILE__), "phpsql");
 function cleanup() {
-       sqlite_close($GLOBALS['db']);
+       if ($GLOBALS['db']) {
+               sqlite_close($GLOBALS['db']);
+       }
        unlink($GLOBALS['dbname']);
 }
 register_shutdown_function("cleanup");
index 7215e7dfd20532813bd044e095d62865880b7e5f..dc280a2e699486e710a68109141c2310fc48b2fd 100755 (executable)
@@ -1,12 +1,13 @@
 --TEST--
-SQLITE: sqlite_open/close
+sqlite: sqlite_open/close
 --SKIPIF--
 <?php if (!extension_loaded("sqlite")) print "skip"; ?>
 --FILE--
 <?php 
-$db = sqlite_open("sqlite.db");
+require_once('blankdb.inc');
 echo "$db\n";
 sqlite_close($db);
+$db = NULL;
 echo "Done\n";
 ?>
 --EXPECTF--
old mode 100644 (file)
new mode 100755 (executable)
similarity index 98%
rename from ext/sqlite/tests/001.phpt
rename to ext/sqlite/tests/sqlite_002.phpt
index 7ebb8ce..537657d
@@ -13,7 +13,7 @@ $r = sqlite_query("SELECT * from foo", $db);
 var_dump(sqlite_fetch_array($r));
 ?>
 --EXPECT--
-array(4) {
+array(6) {
   [0]=>
   string(10) "2002-01-02"
   ["c1"]=>