diff options
author | Marcus Boerger <helly@php.net> | 2003-04-18 20:53:18 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-04-18 20:53:18 +0000 |
commit | cde6bdce5c440de2c7d96ae7c29a882cf3b6484f (patch) | |
tree | ab4705a2e6ea1f66c28de092932d637c1cba4812 | |
parent | 16e873f864dba72279b406958cad3c7fd3f25955 (diff) | |
download | php-git-cde6bdce5c440de2c7d96ae7c29a882cf3b6484f.tar.gz |
Improve test environment, fix 001.phpt and rename that one, also change from /tmp to dirname(__FILE__)
-rw-r--r-- | ext/sqlite/tests/blankdb.inc | 6 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_001.phpt | 5 | ||||
-rwxr-xr-x[-rw-r--r--] | ext/sqlite/tests/sqlite_002.phpt (renamed from ext/sqlite/tests/001.phpt) | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/ext/sqlite/tests/blankdb.inc b/ext/sqlite/tests/blankdb.inc index 45d9753ba8..085d3b2b51 100644 --- a/ext/sqlite/tests/blankdb.inc +++ b/ext/sqlite/tests/blankdb.inc @@ -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"); diff --git a/ext/sqlite/tests/sqlite_001.phpt b/ext/sqlite/tests/sqlite_001.phpt index 7215e7dfd2..dc280a2e69 100755 --- a/ext/sqlite/tests/sqlite_001.phpt +++ b/ext/sqlite/tests/sqlite_001.phpt @@ -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-- diff --git a/ext/sqlite/tests/001.phpt b/ext/sqlite/tests/sqlite_002.phpt index 7ebb8ce465..537657d73c 100644..100755 --- a/ext/sqlite/tests/001.phpt +++ b/ext/sqlite/tests/sqlite_002.phpt @@ -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"]=> |