diff options
author | Felix De Vliegher <felixdv@php.net> | 2008-10-29 11:43:33 +0000 |
---|---|---|
committer | Felix De Vliegher <felixdv@php.net> | 2008-10-29 11:43:33 +0000 |
commit | ac24f7ecfef0097e038b60f764d7938caaf48ccf (patch) | |
tree | 1eadefe6d80378b08b4c337f6a63bede16191bc5 /ext/sqlite/tests/sqlite_exec_basic.phpt | |
parent | 436018a0b7fad24e4f03097771c5f38b4d4f8ba5 (diff) | |
download | php-git-ac24f7ecfef0097e038b60f764d7938caaf48ccf.tar.gz |
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=== |