diff options
author | Felix De Vliegher <felixdv@php.net> | 2008-10-29 11:44:34 +0000 |
---|---|---|
committer | Felix De Vliegher <felixdv@php.net> | 2008-10-29 11:44:34 +0000 |
commit | 101e472c66c7675c11ffceb8f007f0d5a00c4ab2 (patch) | |
tree | 9f74ca3d4e3097b20a8f70d34be7cfb58ac383de /ext/sqlite/tests/sqlite_exec_basic.phpt | |
parent | 7902763a82e8b432f379f5f334e20651f15a71c3 (diff) | |
download | php-git-101e472c66c7675c11ffceb8f007f0d5a00c4ab2.tar.gz |
MFH: Various tests for the sqlite ext.
The sqlite session tests are by Mats Lindh <mats at lindh.no>.
Diffstat (limited to 'ext/sqlite/tests/sqlite_exec_basic.phpt')
-rw-r--r-- | ext/sqlite/tests/sqlite_exec_basic.phpt | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/sqlite/tests/sqlite_exec_basic.phpt b/ext/sqlite/tests/sqlite_exec_basic.phpt new file mode 100644 index 0000000000..e7e13db044 --- /dev/null +++ b/ext/sqlite/tests/sqlite_exec_basic.phpt @@ -0,0 +1,34 @@ +--TEST-- +Test sqlite_exec() function : basic functionality +--SKIPIF-- +<?php if (!extension_loaded("sqlite")) print "skip sqlite extension not loaded"; ?> +--FILE-- +<?php +/* Prototype : boolean sqlite_exec(string query, resource db[, string &error_message]) + * Description: Executes a result-less query against a given database + * Source code: ext/sqlite/sqlite.c + * Alias to functions: + */ + +echo "*** Testing sqlite_exec() : basic functionality ***\n"; + +// set up variables +$query = 'CREATE TABLE foobar (id INTEGER PRIMARY KEY, name CHAR(255));'; +$error_message = null; + +// procedural +$db = sqlite_open(':memory:'); +var_dump( sqlite_exec($db, $query) ); +sqlite_close($db); + +// oo-style +$db = new SQLiteDatabase(':memory:'); +var_dump( $db->queryExec($query, $error_message) ); + +?> +===DONE=== +--EXPECTF-- +*** Testing sqlite_exec() : basic functionality *** +bool(true) +bool(true) +===DONE=== |