cvs: php-src(PHP_5_3) /ext/sqlite3/tests sqlite3_01_open.phpt sqlite3_02_create.phpt sqlite3_03_insert.phpt sqlite3_04_update.phpt
sqlite3_05_delete.phpt sqlite3_06_prepared_stmt.phpt sqlite3_07_prepared_stmt.phpt sqlite3_08_udf.phpt sqlite3_09_blob_bound_param.phpt
sqlite3_10_bound_value_name.phpt sqlite3_11_numrows.phpt sqlite3_12_unfinalized_stmt_cleanup.phpt sqlite3_13_skip_all_cleanup.phpt
sqlite3_14_querysingle.phpt sqlite3_15_open_error.phpt sqlite3_16_select_no_results.phpt sqlite3_17_version.phpt sqlite3_18_changes.phpt
sqlite3_19_columninfo.phpt sqlite3_20_error.phpt sqlite3_21_security.phpt sqlite3_22_loadextension.phpt sqlite3_23_escape_string.phpt
sqlite3_24_last_insert_rowid.phpt sqlite3_25_create_aggregate.phpt sqlite3_26_reset_prepared_stmt.phpt sqlite3_27_reset_prepared_stmt_result.phpt
sqlite3_28_clear_bindings.phpt
| From: | Jani Taskinen | Date: | Sun, 27 Jul 2008 00:05:37 +0000 |
| Subject: | cvs: php-src(PHP_5_3) /ext/sqlite3/tests sqlite3_01_open.phpt sqlite3_02_create.phpt sqlite3_03_insert.phpt sqlite3_04_update.phpt sqlite3_05_delete.phpt sqlite3_06_prepared_stmt.phpt sqlite3_07_prepared_stmt.phpt sqlite3_08_udf.phpt sqlite3_09_blob_bound_param.phpt sqlite3_10_bound_value_name.phpt sqlite3_11_numrows.phpt sqlite3_12_unfinalized_stmt_cleanup.phpt sqlite3_13_skip_all_cleanup.phpt sqlite3_14_querysingle.phpt sqlite3_15_open_error.phpt sqlite3_16_select_no_results.phpt sqlite3_17_version.phpt sqlite3_18_changes.phpt sqlite3_19_columninfo.phpt sqlite3_20_error.phpt sqlite3_21_security.phpt sqlite3_22_loadextension.phpt sqlite3_23_escape_string.phpt sqlite3_24_last_insert_rowid.phpt sqlite3_25_create_aggregate.phpt sqlite3_26_reset_prepared_stmt.phpt sqlite3_27_reset_prepared_stmt_result.phpt sqlite3_28_clear_bindings.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-51640@lists.php.net to get a copy of this message | ||
jani Sun Jul 27 00:05:37 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/sqlite3/tests sqlite3_01_open.phpt
sqlite3_02_create.phpt
sqlite3_03_insert.phpt
sqlite3_04_update.phpt
sqlite3_05_delete.phpt
sqlite3_06_prepared_stmt.phpt
sqlite3_07_prepared_stmt.phpt
sqlite3_08_udf.phpt
sqlite3_09_blob_bound_param.phpt
sqlite3_10_bound_value_name.phpt
sqlite3_11_numrows.phpt
sqlite3_12_unfinalized_stmt_cleanup.phpt
sqlite3_13_skip_all_cleanup.phpt
sqlite3_14_querysingle.phpt
sqlite3_15_open_error.phpt
sqlite3_16_select_no_results.phpt
sqlite3_17_version.phpt
sqlite3_18_changes.phpt
sqlite3_19_columninfo.phpt
sqlite3_20_error.phpt
sqlite3_21_security.phpt
sqlite3_22_loadextension.phpt
sqlite3_23_escape_string.phpt
sqlite3_24_last_insert_rowid.phpt
sqlite3_25_create_aggregate.phpt
sqlite3_26_reset_prepared_stmt.phpt
sqlite3_27_reset_prepared_stmt_result.phpt
sqlite3_28_clear_bindings.phpt
Log:
nuke \r\n
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_01_open.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_01_open.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_01_open.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_01_open.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_01_open.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_01_open.phpt Sun Jul 27 00:05:36 2008 @@ -1,18 +1,18 @@ ---TEST-- -SQLite3::open/close tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -var_dump($db); -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -object(SQLite3)#%d (0) { -} -bool(true) -Done +--TEST-- +SQLite3::open/close tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +var_dump($db); +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +object(SQLite3)#%d (0) { +} +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_02_create.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_02_create.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_02_create.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_02_create.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_02_create.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_02_create.phpt Sun Jul 27 00:05:36 2008 @@ -1,34 +1,34 @@ ---TEST-- -SQLite3::query CREATE tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "Creating Same Table Again\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "Dropping database\n"; -var_dump($db->exec('DROP TABLE test')); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -Creating Same Table Again - -Warning: SQLite3::exec(): table test already exists in %s on line %d -bool(false) -Dropping database -bool(true) -Closing database -bool(true) -Done +--TEST-- +SQLite3::query CREATE tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "Creating Same Table Again\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "Dropping database\n"; +var_dump($db->exec('DROP TABLE test')); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +Creating Same Table Again + +Warning: SQLite3::exec(): table test already exists in %s on line %d +bool(false) +Dropping database +bool(true) +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt Sun Jul 27 00:05:36 2008 @@ -1,51 +1,51 @@ ---TEST-- -SQLite3::query INSERT tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::query INSERT tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_04_update.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_04_update.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_04_update.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_04_update.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_04_update.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_04_update.phpt Sun Jul 27 00:05:36 2008 @@ -1,77 +1,77 @@ ---TEST-- -SQLite3::query UPDATE tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "UPDATING results\n"; -var_dump($db->exec("UPDATE test SET id = 'c' WHERE id = 'a'")); - -echo "Checking results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -UPDATING results -bool(true) -Checking results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "c" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::query UPDATE tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "UPDATING results\n"; +var_dump($db->exec("UPDATE test SET id = 'c' WHERE id = 'a'")); + +echo "Checking results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +UPDATING results +bool(true) +Checking results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "c" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt Sun Jul 27 00:05:36 2008 @@ -1,71 +1,71 @@ ---TEST-- -SQLite3::query DELETE tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "DELETING a row\n"; -var_dump($db->exec("DELETE FROM test WHERE id = 'a'")); - -echo "Checking results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -DELETING a row -bool(true) -Checking results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::query DELETE tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "DELETING a row\n"; +var_dump($db->exec("DELETE FROM test WHERE id = 'a'")); + +echo "Checking results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +DELETING a row +bool(true) +Checking results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt Sun Jul 27 00:05:36 2008 @@ -1,52 +1,52 @@ ---TEST-- -SQLite3::prepare Bound Variable test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'c'; -echo "BINDING Parameter\n"; -var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); -$foo = 'a'; -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Parameter -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare Bound Variable test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'c'; +echo "BINDING Parameter\n"; +var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); +$foo = 'a'; +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Parameter +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt Sun Jul 27 00:05:36 2008 @@ -1,51 +1,51 @@ ---TEST-- -SQLite3::prepare Bound Value test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'a'; -echo "BINDING Value\n"; -var_dump($stmt->bindValue(1, $foo, SQLITE3_TEXT)); -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Value -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare Bound Value test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'a'; +echo "BINDING Value\n"; +var_dump($stmt->bindValue(1, $foo, SQLITE3_TEXT)); +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Value +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt Sun Jul 27 00:05:36 2008 @@ -1,57 +1,57 @@ ---TEST-- -SQLite3::createFunction ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -function my_udf_md5($foo) -{ - return md5($foo); -} - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "CREATING UDF\n"; -var_dump($db->createFunction('my_udf_md5', 'my_udf_md5')); - -echo "SELECTING results\n"; -$results = $db->query("SELECT my_udf_md5(id) FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -CREATING UDF -bool(true) -SELECTING results -array(1) { - [0]=> - string(32) "0cc175b9c0f1b6a831c399e269772661" -} -array(1) { - [0]=> - string(32) "92eb5ffee6ae2fec3ad71c777531578f" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::createFunction +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +function my_udf_md5($foo) +{ + return md5($foo); +} + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "CREATING UDF\n"; +var_dump($db->createFunction('my_udf_md5', 'my_udf_md5')); + +echo "SELECTING results\n"; +$results = $db->query("SELECT my_udf_md5(id) FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +CREATING UDF +bool(true) +SELECTING results +array(1) { + [0]=> + string(32) "0cc175b9c0f1b6a831c399e269772661" +} +array(1) { + [0]=> + string(32) "92eb5ffee6ae2fec3ad71c777531578f" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt Sun Jul 27 00:05:36 2008 @@ -1,61 +1,61 @@ ---TEST-- -SQLite3::prepare Bound Variable Blob test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -require_once(dirname(__FILE__) . '/stream_test.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (id STRING, data BLOB)')); - -echo "PREPARING insert\n"; -$insert_stmt = $db->prepare("INSERT INTO test (id, data) VALUES (?, ?)"); - -echo "Opening blob stream\n"; -$foo = fopen('sqliteBlobTest://fooo', 'r'); -var_dump($foo); - -echo "BINDING Parameter\n"; -var_dump($insert_stmt->bindValue(1, 'a', SQLITE3_TEXT)); -var_dump($insert_stmt->bindParam(2, $foo, SQLITE3_BLOB)); -$insert_stmt->execute(); -echo "Closing statement\n"; -var_dump($insert_stmt->close()); - -echo "SELECTING results\n"; -$results = $db->query("SELECT id, quote(data) AS data FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -PREPARING insert -Opening blob stream -resource(%d) of type (stream) -BINDING Parameter -bool(true) -bool(true) -Closing statement -bool(true) -SELECTING results -array(2) { - [0]=> - string(1) "a" - [1]=> - string(23) "X'61626364656667006869'" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare Bound Variable Blob test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +require_once(dirname(__FILE__) . '/stream_test.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (id STRING, data BLOB)')); + +echo "PREPARING insert\n"; +$insert_stmt = $db->prepare("INSERT INTO test (id, data) VALUES (?, ?)"); + +echo "Opening blob stream\n"; +$foo = fopen('sqliteBlobTest://fooo', 'r'); +var_dump($foo); + +echo "BINDING Parameter\n"; +var_dump($insert_stmt->bindValue(1, 'a', SQLITE3_TEXT)); +var_dump($insert_stmt->bindParam(2, $foo, SQLITE3_BLOB)); +$insert_stmt->execute(); +echo "Closing statement\n"; +var_dump($insert_stmt->close()); + +echo "SELECTING results\n"; +$results = $db->query("SELECT id, quote(data) AS data FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +PREPARING insert +Opening blob stream +resource(%d) of type (stream) +BINDING Parameter +bool(true) +bool(true) +Closing statement +bool(true) +SELECTING results +array(2) { + [0]=> + string(1) "a" + [1]=> + string(23) "X'61626364656667006869'" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt Sun Jul 27 00:05:36 2008 @@ -1,55 +1,55 @@ ---TEST-- -SQLite3::prepare Bound Value test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = :id ORDER BY id ASC"); -$foo = 'a'; -echo "BINDING Value\n"; -var_dump($stmt->bindValue(':id', $foo, SQLITE3_TEXT)); -echo "BINDING Value Again\n"; -var_dump($stmt->bindValue('id', $foo, SQLITE3_TEXT)); -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Value -bool(true) -BINDING Value Again -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare Bound Value test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = :id ORDER BY id ASC"); +$foo = 'a'; +echo "BINDING Value\n"; +var_dump($stmt->bindValue(':id', $foo, SQLITE3_TEXT)); +echo "BINDING Value Again\n"; +var_dump($stmt->bindValue('id', $foo, SQLITE3_TEXT)); +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Value +bool(true) +BINDING Value Again +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt Sun Jul 27 00:05:36 2008 @@ -1,46 +1,46 @@ ---TEST-- -SQLite3::prepare number of rows ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); -// Create an instance of the ReflectionMethod class -try { - $method = new ReflectionMethod('sqlite3_result', 'numRows'); -} catch (ReflectionException $e) { - die("skip"); -} -?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -echo "Number of rows\n"; -var_dump($results->numRows()); -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -Number of rows -int(2) -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare number of rows +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); +// Create an instance of the ReflectionMethod class +try { + $method = new ReflectionMethod('sqlite3_result', 'numRows'); +} catch (ReflectionException $e) { + die("skip"); +} +?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +echo "Number of rows\n"; +var_dump($results->numRows()); +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +Number of rows +int(2) +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt Sun Jul 27 00:05:36 2008 @@ -1,50 +1,50 @@ ---TEST-- -SQLite3::query Unfinalized statement tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); - /* Only read one row and break */ - break; -} - -echo "Closing database\n"; -var_dump($db->close()); -echo "Check result was freed\n"; -var_dump($results); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Check result was freed -NULL -Done +--TEST-- +SQLite3::query Unfinalized statement tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); + /* Only read one row and break */ + break; +} + +echo "Closing database\n"; +var_dump($db->close()); +echo "Check result was freed\n"; +var_dump($results); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Check result was freed +NULL +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt Sun Jul 27 00:05:36 2008 @@ -1,45 +1,45 @@ ---TEST-- -SQLite3::query Skip all cleanup ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -Done +--TEST-- +SQLite3::query Skip all cleanup +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt Sun Jul 27 00:05:36 2008 @@ -1,38 +1,38 @@ ---TEST-- -SQLite3::querySingle tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -var_dump($db->querySingle("SELECT id FROM test WHERE id = 'a'")); -var_dump($db->querySingle("SELECT id, time FROM test WHERE id = 'a'", true)); - -echo "Done" -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -string(1) "a" -array(2) { - ["id"]=> - string(1) "a" - ["time"]=> - int(%d) -} -Done +--TEST-- +SQLite3::querySingle tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +var_dump($db->querySingle("SELECT id FROM test WHERE id = 'a'")); +var_dump($db->querySingle("SELECT id, time FROM test WHERE id = 'a'", true)); + +echo "Done" +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +string(1) "a" +array(2) { + ["id"]=> + string(1) "a" + ["time"]=> + int(%d) +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt Sun Jul 27 00:05:36 2008 @@ -1,20 +1,20 @@ ---TEST-- -SQLite3::open error test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php -$unreadable = dirname(__FILE__) . '/unreadable.db'; -touch($unreadable); -chmod($unreadable, 0200); -$db = new SQLite3($unreadable); - -var_dump($db); -echo "Done\n"; -unlink($unreadable); -?> ---EXPECTF-- -Notice: SQLite3::__construct(): Unable to open database: unable to open database file in %s/sqlite3_15_open_error.php on line %d -object(SQLite3)#%d (0) { -} -Done +--TEST-- +SQLite3::open error test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php +$unreadable = dirname(__FILE__) . '/unreadable.db'; +touch($unreadable); +chmod($unreadable, 0200); +$db = new SQLite3($unreadable); + +var_dump($db); +echo "Done\n"; +unlink($unreadable); +?> +--EXPECTF-- +Notice: SQLite3::__construct(): Unable to open database: unable to open database file in %s/sqlite3_15_open_error.php on line %d +object(SQLite3)#%d (0) { +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt Sun Jul 27 00:05:36 2008 @@ -1,32 +1,32 @@ ---TEST-- -SQLite3::query SELECT with no results ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -SELECTING results -Closing database -bool(true) -Done +--TEST-- +SQLite3::query SELECT with no results +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +SELECTING results +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_17_version.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_17_version.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_17_version.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_17_version.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_17_version.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_17_version.phpt Sun Jul 27 00:05:36 2008 @@ -1,16 +1,16 @@ ---TEST-- -SQLite3::version() ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php -print_r(SQLite3::version()); -echo "Done\n"; -?> ---EXPECTF-- -Array -( - [versionString] => %d.%d.%d - [versionNumber] => %d -) -Done +--TEST-- +SQLite3::version() +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php +print_r(SQLite3::version()); +echo "Done\n"; +?> +--EXPECTF-- +Array +( + [versionString] => %d.%d.%d + [versionNumber] => %d +) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt Sun Jul 27 00:05:36 2008 @@ -1,40 +1,40 @@ ---TEST-- -SQLite3::changes() tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "UPDATE query\n"; -var_dump($db->exec("UPDATE test SET id = 'c'")); - -echo "Rows Updated\n"; -var_dump($db->changes()); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -UPDATE query -bool(true) -Rows Updated -int(2) -Closing database -bool(true) -Done +--TEST-- +SQLite3::changes() tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "UPDATE query\n"; +var_dump($db->exec("UPDATE test SET id = 'c'")); + +echo "Rows Updated\n"; +var_dump($db->changes()); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +UPDATE query +bool(true) +Rows Updated +int(2) +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt Sun Jul 27 00:05:36 2008 @@ -1,45 +1,45 @@ ---TEST-- -SQLite3 columnType and columnName ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$result = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($row = $result->fetchArray(SQLITE3_NUM)) { - $totalColumns = $result->numColumns(); - for ($i = 0; $i < $totalColumns; $i++) { - echo "Name: " . $result->columnName($i) . " - Type: " . $result->columnType($i) . "\n"; - } -} -$result->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -Name: time - Type: 1 -Name: id - Type: 3 -Name: time - Type: 1 -Name: id - Type: 3 -Closing database -bool(true) -Done +--TEST-- +SQLite3 columnType and columnName +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$result = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($row = $result->fetchArray(SQLITE3_NUM)) { + $totalColumns = $result->numColumns(); + for ($i = 0; $i < $totalColumns; $i++) { + echo "Name: " . $result->columnName($i) . " - Type: " . $result->columnType($i) . "\n"; + } +} +$result->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +Name: time - Type: 1 +Name: id - Type: 3 +Name: time - Type: 1 +Name: id - Type: 3 +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_20_error.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_20_error.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_20_error.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_20_error.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_20_error.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_20_error.phpt Sun Jul 27 00:05:36 2008 @@ -1,28 +1,28 @@ ---TEST-- -SQLite3 error functions ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -echo "SELECTING from invalid table\n"; -$result = $db->query("SELECT * FROM non_existent_table"); -if (!$result) { - echo "Error Code: " . $db->lastErrorCode() . "\n"; - echo "Error Msg: " . $db->lastErrorMsg() . "\n"; -} -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -SELECTING from invalid table - -Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %s on line %d -Error Code: 1 -Error Msg: no such table: non_existent_table -Closing database -bool(true) -Done +--TEST-- +SQLite3 error functions +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +echo "SELECTING from invalid table\n"; +$result = $db->query("SELECT * FROM non_existent_table"); +if (!$result) { + echo "Error Code: " . $db->lastErrorCode() . "\n"; + echo "Error Msg: " . $db->lastErrorMsg() . "\n"; +} +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +SELECTING from invalid table + +Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %s on line %d +Error Code: 1 +Error Msg: no such table: non_existent_table +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_21_security.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_21_security.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_21_security.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_21_security.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_21_security.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_21_security.phpt Sun Jul 27 00:05:36 2008 @@ -1,34 +1,34 @@ ---TEST-- -SQLite3 open_basedir / safe_mode checks ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---INI-- -open_basedir=. ---FILE-- -<?php -$directory = dirname(__FILE__) . '/'; -$file = uniqid() . '.db'; - -echo "Within test directory\n"; -$db = new SQLite3($directory . $file); -var_dump($db); -var_dump($db->close()); -unlink($directory . $file); - -echo "Above test directory\n"; -$db = new SQLite3('../bad' . $file); -var_dump($db); - -echo "Done\n"; -?> ---EXPECTF-- -Within test directory -object(SQLite3)#%d (0) { -} -bool(true) -Above test directory - -Warning: SQLite3::__construct(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d -object(SQLite3)#%d (0) { -} -Done +--TEST-- +SQLite3 open_basedir / safe_mode checks +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--INI-- +open_basedir=. +--FILE-- +<?php +$directory = dirname(__FILE__) . '/'; +$file = uniqid() . '.db'; + +echo "Within test directory\n"; +$db = new SQLite3($directory . $file); +var_dump($db); +var_dump($db->close()); +unlink($directory . $file); + +echo "Above test directory\n"; +$db = new SQLite3('../bad' . $file); +var_dump($db); + +echo "Done\n"; +?> +--EXPECTF-- +Within test directory +object(SQLite3)#%d (0) { +} +bool(true) +Above test directory + +Warning: SQLite3::__construct(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d +object(SQLite3)#%d (0) { +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt Sun Jul 27 00:05:36 2008 @@ -1,27 +1,27 @@ ---TEST-- -SQLite3 load extension ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---INI-- -open_basedir=. -sqlite3.extension_dir=. ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -$directory = dirname(__FILE__); - -touch($directory . '/myext.txt'); - -var_dump($db->loadExtension('myext.txt')); -var_dump($db->close()); -unlink($directory . '/myext.txt'); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: SQLite3::loadExtension(): Unable to load extension at './myext.txt' in %s on line %d -bool(false) -bool(true) -Done +--TEST-- +SQLite3 load extension +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--INI-- +open_basedir=. +sqlite3.extension_dir=. +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +$directory = dirname(__FILE__); + +touch($directory . '/myext.txt'); + +var_dump($db->loadExtension('myext.txt')); +var_dump($db->close()); +unlink($directory . '/myext.txt'); + +echo "Done\n"; +?> +--EXPECTF-- +Warning: SQLite3::loadExtension(): Unable to load extension at './myext.txt' in %s on line %d +bool(false) +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt Sun Jul 27 00:05:36 2008 @@ -1,51 +1,51 @@ ---TEST-- -SQLite3::escapeString ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", '" . $db->escapeString("test''%") . "')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(7) "test''%" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::escapeString +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", '" . $db->escapeString("test''%") . "')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(7) "test''%" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt Sun Jul 27 00:05:36 2008 @@ -1,34 +1,34 @@ ---TEST-- -SQLite3::lastInsertRowID tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->lastInsertRowID()); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); -var_dump($db->lastInsertRowID()); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -int(1) -bool(true) -int(2) -Closing database -bool(true) -Done +--TEST-- +SQLite3::lastInsertRowID tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->lastInsertRowID()); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); +var_dump($db->lastInsertRowID()); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +int(1) +bool(true) +int(2) +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt Sun Jul 27 00:05:36 2008 @@ -1,56 +1,56 @@ ---TEST-- -SQLite3::createAggregate() test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -function sum_list_step(&$context, $string) { - if (empty($context)) - { - $context = array('total' => 0, 'values' => array()); - } - var_dump($context); - $context['total'] += intval($string); - $context['values'][] = $context['total']; - return true; -} - -function sum_list_finalize(&$context) { - var_dump($context); - return implode(',', $context['values']); -} - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (a INTEGER, b INTEGER)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (a, b) VALUES (1, -1)")); -var_dump($db->exec("INSERT INTO test (a, b) VALUES (2, -2)")); -var_dump($db->exec("INSERT INTO test (a, b) VALUES (3, -3)")); -var_dump($db->exec("INSERT INTO test (a, b) VALUES (4, -4)")); -var_dump($db->exec("INSERT INTO test (a, b) VALUES (4, -4)")); - -$db->createAggregate('S', 'sum_list_step', 'sum_list_finalize', 1); - -print_r($db->querySingle("SELECT S(a), S(b) FROM test", true)); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Closing database -bool(true) -Done +--TEST-- +SQLite3::createAggregate() test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +function sum_list_step(&$context, $string) { + if (empty($context)) + { + $context = array('total' => 0, 'values' => array()); + } + var_dump($context); + $context['total'] += intval($string); + $context['values'][] = $context['total']; + return true; +} + +function sum_list_finalize(&$context) { + var_dump($context); + return implode(',', $context['values']); +} + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (a INTEGER, b INTEGER)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (a, b) VALUES (1, -1)")); +var_dump($db->exec("INSERT INTO test (a, b) VALUES (2, -2)")); +var_dump($db->exec("INSERT INTO test (a, b) VALUES (3, -3)")); +var_dump($db->exec("INSERT INTO test (a, b) VALUES (4, -4)")); +var_dump($db->exec("INSERT INTO test (a, b) VALUES (4, -4)")); + +$db->createAggregate('S', 'sum_list_step', 'sum_list_finalize', 1); + +print_r($db->querySingle("SELECT S(a), S(b) FROM test", true)); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt Sun Jul 27 00:05:36 2008 @@ -1,61 +1,61 @@ ---TEST-- -SQLite3::reset prepared statement ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'c'; -echo "BINDING Parameter\n"; -var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); -$foo = 'a'; -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$stmt->reset(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Parameter -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::reset prepared statement +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'c'; +echo "BINDING Parameter\n"; +var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); +$foo = 'a'; +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$stmt->reset(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Parameter +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt Sun Jul 27 00:05:36 2008 @@ -1,61 +1,61 @@ ---TEST-- -SQLite3::reset prepared statement results ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'c'; -echo "BINDING Parameter\n"; -var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); -$foo = 'a'; -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$results->reset(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Parameter -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::reset prepared statement results +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'c'; +echo "BINDING Parameter\n"; +var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); +$foo = 'a'; +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$results->reset(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Parameter +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt Sun Jul 27 00:05:36 2008 @@ -1,65 +1,65 @@ ---TEST-- -SQLite3_stmt::clear prepared statement results ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'c'; -echo "BINDING Parameter\n"; -var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); -$foo = 'a'; -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$stmt->reset(); -$stmt->clear(); -var_dump($stmt->bindValue(1, 'b', SQLITE3_TEXT)); -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Parameter -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3_stmt::clear prepared statement results +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'c'; +echo "BINDING Parameter\n"; +var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); +$foo = 'a'; +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$stmt->reset(); +$stmt->clear(); +var_dump($stmt->bindValue(1, 'b', SQLITE3_TEXT)); +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Parameter +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +Closing database +bool(true) +Done
http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_01_open.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_01_open.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_01_open.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_01_open.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_01_open.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_01_open.phpt Sun Jul 27 00:05:36 2008 @@ -1,18 +1,18 @@ ---TEST-- -SQLite3::open/close tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -var_dump($db); -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -object(SQLite3)#%d (0) { -} -bool(true) -Done +--TEST-- +SQLite3::open/close tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +var_dump($db); +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +object(SQLite3)#%d (0) { +} +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_02_create.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_02_create.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_02_create.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_02_create.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_02_create.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_02_create.phpt Sun Jul 27 00:05:36 2008 @@ -1,34 +1,34 @@ ---TEST-- -SQLite3::query CREATE tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "Creating Same Table Again\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "Dropping database\n"; -var_dump($db->exec('DROP TABLE test')); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -Creating Same Table Again - -Warning: SQLite3::exec(): table test already exists in %s on line %d -bool(false) -Dropping database -bool(true) -Closing database -bool(true) -Done +--TEST-- +SQLite3::query CREATE tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "Creating Same Table Again\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "Dropping database\n"; +var_dump($db->exec('DROP TABLE test')); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +Creating Same Table Again + +Warning: SQLite3::exec(): table test already exists in %s on line %d +bool(false) +Dropping database +bool(true) +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_03_insert.phpt Sun Jul 27 00:05:36 2008 @@ -1,51 +1,51 @@ ---TEST-- -SQLite3::query INSERT tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::query INSERT tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_04_update.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_04_update.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_04_update.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_04_update.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_04_update.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_04_update.phpt Sun Jul 27 00:05:36 2008 @@ -1,77 +1,77 @@ ---TEST-- -SQLite3::query UPDATE tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "UPDATING results\n"; -var_dump($db->exec("UPDATE test SET id = 'c' WHERE id = 'a'")); - -echo "Checking results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -UPDATING results -bool(true) -Checking results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "c" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::query UPDATE tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "UPDATING results\n"; +var_dump($db->exec("UPDATE test SET id = 'c' WHERE id = 'a'")); + +echo "Checking results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +UPDATING results +bool(true) +Checking results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "c" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_05_delete.phpt Sun Jul 27 00:05:36 2008 @@ -1,71 +1,71 @@ ---TEST-- -SQLite3::query DELETE tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "DELETING a row\n"; -var_dump($db->exec("DELETE FROM test WHERE id = 'a'")); - -echo "Checking results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -DELETING a row -bool(true) -Checking results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::query DELETE tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "DELETING a row\n"; +var_dump($db->exec("DELETE FROM test WHERE id = 'a'")); + +echo "Checking results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +DELETING a row +bool(true) +Checking results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_06_prepared_stmt.phpt Sun Jul 27 00:05:36 2008 @@ -1,52 +1,52 @@ ---TEST-- -SQLite3::prepare Bound Variable test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'c'; -echo "BINDING Parameter\n"; -var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); -$foo = 'a'; -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Parameter -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare Bound Variable test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'c'; +echo "BINDING Parameter\n"; +var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); +$foo = 'a'; +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Parameter +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_07_prepared_stmt.phpt Sun Jul 27 00:05:36 2008 @@ -1,51 +1,51 @@ ---TEST-- -SQLite3::prepare Bound Value test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'a'; -echo "BINDING Value\n"; -var_dump($stmt->bindValue(1, $foo, SQLITE3_TEXT)); -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Value -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare Bound Value test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'a'; +echo "BINDING Value\n"; +var_dump($stmt->bindValue(1, $foo, SQLITE3_TEXT)); +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Value +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_08_udf.phpt Sun Jul 27 00:05:36 2008 @@ -1,57 +1,57 @@ ---TEST-- -SQLite3::createFunction ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -function my_udf_md5($foo) -{ - return md5($foo); -} - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "CREATING UDF\n"; -var_dump($db->createFunction('my_udf_md5', 'my_udf_md5')); - -echo "SELECTING results\n"; -$results = $db->query("SELECT my_udf_md5(id) FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -CREATING UDF -bool(true) -SELECTING results -array(1) { - [0]=> - string(32) "0cc175b9c0f1b6a831c399e269772661" -} -array(1) { - [0]=> - string(32) "92eb5ffee6ae2fec3ad71c777531578f" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::createFunction +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +function my_udf_md5($foo) +{ + return md5($foo); +} + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "CREATING UDF\n"; +var_dump($db->createFunction('my_udf_md5', 'my_udf_md5')); + +echo "SELECTING results\n"; +$results = $db->query("SELECT my_udf_md5(id) FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +CREATING UDF +bool(true) +SELECTING results +array(1) { + [0]=> + string(32) "0cc175b9c0f1b6a831c399e269772661" +} +array(1) { + [0]=> + string(32) "92eb5ffee6ae2fec3ad71c777531578f" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_09_blob_bound_param.phpt Sun Jul 27 00:05:36 2008 @@ -1,61 +1,61 @@ ---TEST-- -SQLite3::prepare Bound Variable Blob test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -require_once(dirname(__FILE__) . '/stream_test.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (id STRING, data BLOB)')); - -echo "PREPARING insert\n"; -$insert_stmt = $db->prepare("INSERT INTO test (id, data) VALUES (?, ?)"); - -echo "Opening blob stream\n"; -$foo = fopen('sqliteBlobTest://fooo', 'r'); -var_dump($foo); - -echo "BINDING Parameter\n"; -var_dump($insert_stmt->bindValue(1, 'a', SQLITE3_TEXT)); -var_dump($insert_stmt->bindParam(2, $foo, SQLITE3_BLOB)); -$insert_stmt->execute(); -echo "Closing statement\n"; -var_dump($insert_stmt->close()); - -echo "SELECTING results\n"; -$results = $db->query("SELECT id, quote(data) AS data FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -PREPARING insert -Opening blob stream -resource(%d) of type (stream) -BINDING Parameter -bool(true) -bool(true) -Closing statement -bool(true) -SELECTING results -array(2) { - [0]=> - string(1) "a" - [1]=> - string(23) "X'61626364656667006869'" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare Bound Variable Blob test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +require_once(dirname(__FILE__) . '/stream_test.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (id STRING, data BLOB)')); + +echo "PREPARING insert\n"; +$insert_stmt = $db->prepare("INSERT INTO test (id, data) VALUES (?, ?)"); + +echo "Opening blob stream\n"; +$foo = fopen('sqliteBlobTest://fooo', 'r'); +var_dump($foo); + +echo "BINDING Parameter\n"; +var_dump($insert_stmt->bindValue(1, 'a', SQLITE3_TEXT)); +var_dump($insert_stmt->bindParam(2, $foo, SQLITE3_BLOB)); +$insert_stmt->execute(); +echo "Closing statement\n"; +var_dump($insert_stmt->close()); + +echo "SELECTING results\n"; +$results = $db->query("SELECT id, quote(data) AS data FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +PREPARING insert +Opening blob stream +resource(%d) of type (stream) +BINDING Parameter +bool(true) +bool(true) +Closing statement +bool(true) +SELECTING results +array(2) { + [0]=> + string(1) "a" + [1]=> + string(23) "X'61626364656667006869'" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_10_bound_value_name.phpt Sun Jul 27 00:05:36 2008 @@ -1,55 +1,55 @@ ---TEST-- -SQLite3::prepare Bound Value test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = :id ORDER BY id ASC"); -$foo = 'a'; -echo "BINDING Value\n"; -var_dump($stmt->bindValue(':id', $foo, SQLITE3_TEXT)); -echo "BINDING Value Again\n"; -var_dump($stmt->bindValue('id', $foo, SQLITE3_TEXT)); -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Value -bool(true) -BINDING Value Again -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare Bound Value test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = :id ORDER BY id ASC"); +$foo = 'a'; +echo "BINDING Value\n"; +var_dump($stmt->bindValue(':id', $foo, SQLITE3_TEXT)); +echo "BINDING Value Again\n"; +var_dump($stmt->bindValue('id', $foo, SQLITE3_TEXT)); +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Value +bool(true) +BINDING Value Again +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_11_numrows.phpt Sun Jul 27 00:05:36 2008 @@ -1,46 +1,46 @@ ---TEST-- -SQLite3::prepare number of rows ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); -// Create an instance of the ReflectionMethod class -try { - $method = new ReflectionMethod('sqlite3_result', 'numRows'); -} catch (ReflectionException $e) { - die("skip"); -} -?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -echo "Number of rows\n"; -var_dump($results->numRows()); -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -Number of rows -int(2) -Closing database -bool(true) -Done +--TEST-- +SQLite3::prepare number of rows +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); +// Create an instance of the ReflectionMethod class +try { + $method = new ReflectionMethod('sqlite3_result', 'numRows'); +} catch (ReflectionException $e) { + die("skip"); +} +?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +echo "Number of rows\n"; +var_dump($results->numRows()); +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +Number of rows +int(2) +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt Sun Jul 27 00:05:36 2008 @@ -1,50 +1,50 @@ ---TEST-- -SQLite3::query Unfinalized statement tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); - /* Only read one row and break */ - break; -} - -echo "Closing database\n"; -var_dump($db->close()); -echo "Check result was freed\n"; -var_dump($results); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Check result was freed -NULL -Done +--TEST-- +SQLite3::query Unfinalized statement tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); + /* Only read one row and break */ + break; +} + +echo "Closing database\n"; +var_dump($db->close()); +echo "Check result was freed\n"; +var_dump($results); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Check result was freed +NULL +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_13_skip_all_cleanup.phpt Sun Jul 27 00:05:36 2008 @@ -1,45 +1,45 @@ ---TEST-- -SQLite3::query Skip all cleanup ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -Done +--TEST-- +SQLite3::query Skip all cleanup +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_14_querysingle.phpt Sun Jul 27 00:05:36 2008 @@ -1,38 +1,38 @@ ---TEST-- -SQLite3::querySingle tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -var_dump($db->querySingle("SELECT id FROM test WHERE id = 'a'")); -var_dump($db->querySingle("SELECT id, time FROM test WHERE id = 'a'", true)); - -echo "Done" -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -string(1) "a" -array(2) { - ["id"]=> - string(1) "a" - ["time"]=> - int(%d) -} -Done +--TEST-- +SQLite3::querySingle tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +var_dump($db->querySingle("SELECT id FROM test WHERE id = 'a'")); +var_dump($db->querySingle("SELECT id, time FROM test WHERE id = 'a'", true)); + +echo "Done" +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +string(1) "a" +array(2) { + ["id"]=> + string(1) "a" + ["time"]=> + int(%d) +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_15_open_error.phpt Sun Jul 27 00:05:36 2008 @@ -1,20 +1,20 @@ ---TEST-- -SQLite3::open error test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php -$unreadable = dirname(__FILE__) . '/unreadable.db'; -touch($unreadable); -chmod($unreadable, 0200); -$db = new SQLite3($unreadable); - -var_dump($db); -echo "Done\n"; -unlink($unreadable); -?> ---EXPECTF-- -Notice: SQLite3::__construct(): Unable to open database: unable to open database file in %s/sqlite3_15_open_error.php on line %d -object(SQLite3)#%d (0) { -} -Done +--TEST-- +SQLite3::open error test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php +$unreadable = dirname(__FILE__) . '/unreadable.db'; +touch($unreadable); +chmod($unreadable, 0200); +$db = new SQLite3($unreadable); + +var_dump($db); +echo "Done\n"; +unlink($unreadable); +?> +--EXPECTF-- +Notice: SQLite3::__construct(): Unable to open database: unable to open database file in %s/sqlite3_15_open_error.php on line %d +object(SQLite3)#%d (0) { +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_16_select_no_results.phpt Sun Jul 27 00:05:36 2008 @@ -1,32 +1,32 @@ ---TEST-- -SQLite3::query SELECT with no results ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -SELECTING results -Closing database -bool(true) -Done +--TEST-- +SQLite3::query SELECT with no results +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +SELECTING results +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_17_version.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_17_version.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_17_version.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_17_version.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_17_version.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_17_version.phpt Sun Jul 27 00:05:36 2008 @@ -1,16 +1,16 @@ ---TEST-- -SQLite3::version() ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php -print_r(SQLite3::version()); -echo "Done\n"; -?> ---EXPECTF-- -Array -( - [versionString] => %d.%d.%d - [versionNumber] => %d -) -Done +--TEST-- +SQLite3::version() +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php +print_r(SQLite3::version()); +echo "Done\n"; +?> +--EXPECTF-- +Array +( + [versionString] => %d.%d.%d + [versionNumber] => %d +) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_18_changes.phpt Sun Jul 27 00:05:36 2008 @@ -1,40 +1,40 @@ ---TEST-- -SQLite3::changes() tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "UPDATE query\n"; -var_dump($db->exec("UPDATE test SET id = 'c'")); - -echo "Rows Updated\n"; -var_dump($db->changes()); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -UPDATE query -bool(true) -Rows Updated -int(2) -Closing database -bool(true) -Done +--TEST-- +SQLite3::changes() tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "UPDATE query\n"; +var_dump($db->exec("UPDATE test SET id = 'c'")); + +echo "Rows Updated\n"; +var_dump($db->changes()); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +UPDATE query +bool(true) +Rows Updated +int(2) +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_19_columninfo.phpt Sun Jul 27 00:05:36 2008 @@ -1,45 +1,45 @@ ---TEST-- -SQLite3 columnType and columnName ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$result = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($row = $result->fetchArray(SQLITE3_NUM)) { - $totalColumns = $result->numColumns(); - for ($i = 0; $i < $totalColumns; $i++) { - echo "Name: " . $result->columnName($i) . " - Type: " . $result->columnType($i) . "\n"; - } -} -$result->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -Name: time - Type: 1 -Name: id - Type: 3 -Name: time - Type: 1 -Name: id - Type: 3 -Closing database -bool(true) -Done +--TEST-- +SQLite3 columnType and columnName +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$result = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($row = $result->fetchArray(SQLITE3_NUM)) { + $totalColumns = $result->numColumns(); + for ($i = 0; $i < $totalColumns; $i++) { + echo "Name: " . $result->columnName($i) . " - Type: " . $result->columnType($i) . "\n"; + } +} +$result->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +Name: time - Type: 1 +Name: id - Type: 3 +Name: time - Type: 1 +Name: id - Type: 3 +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_20_error.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_20_error.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_20_error.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_20_error.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_20_error.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_20_error.phpt Sun Jul 27 00:05:36 2008 @@ -1,28 +1,28 @@ ---TEST-- -SQLite3 error functions ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -echo "SELECTING from invalid table\n"; -$result = $db->query("SELECT * FROM non_existent_table"); -if (!$result) { - echo "Error Code: " . $db->lastErrorCode() . "\n"; - echo "Error Msg: " . $db->lastErrorMsg() . "\n"; -} -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -SELECTING from invalid table - -Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %s on line %d -Error Code: 1 -Error Msg: no such table: non_existent_table -Closing database -bool(true) -Done +--TEST-- +SQLite3 error functions +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +echo "SELECTING from invalid table\n"; +$result = $db->query("SELECT * FROM non_existent_table"); +if (!$result) { + echo "Error Code: " . $db->lastErrorCode() . "\n"; + echo "Error Msg: " . $db->lastErrorMsg() . "\n"; +} +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +SELECTING from invalid table + +Warning: SQLite3::query(): Unable to prepare statement: 1, no such table: non_existent_table in %s on line %d +Error Code: 1 +Error Msg: no such table: non_existent_table +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_21_security.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_21_security.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_21_security.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_21_security.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_21_security.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_21_security.phpt Sun Jul 27 00:05:36 2008 @@ -1,34 +1,34 @@ ---TEST-- -SQLite3 open_basedir / safe_mode checks ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---INI-- -open_basedir=. ---FILE-- -<?php -$directory = dirname(__FILE__) . '/'; -$file = uniqid() . '.db'; - -echo "Within test directory\n"; -$db = new SQLite3($directory . $file); -var_dump($db); -var_dump($db->close()); -unlink($directory . $file); - -echo "Above test directory\n"; -$db = new SQLite3('../bad' . $file); -var_dump($db); - -echo "Done\n"; -?> ---EXPECTF-- -Within test directory -object(SQLite3)#%d (0) { -} -bool(true) -Above test directory - -Warning: SQLite3::__construct(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d -object(SQLite3)#%d (0) { -} -Done +--TEST-- +SQLite3 open_basedir / safe_mode checks +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--INI-- +open_basedir=. +--FILE-- +<?php +$directory = dirname(__FILE__) . '/'; +$file = uniqid() . '.db'; + +echo "Within test directory\n"; +$db = new SQLite3($directory . $file); +var_dump($db); +var_dump($db->close()); +unlink($directory . $file); + +echo "Above test directory\n"; +$db = new SQLite3('../bad' . $file); +var_dump($db); + +echo "Done\n"; +?> +--EXPECTF-- +Within test directory +object(SQLite3)#%d (0) { +} +bool(true) +Above test directory + +Warning: SQLite3::__construct(): open_basedir restriction in effect. File(%s) is not within the allowed path(s): (.) in %s on line %d +object(SQLite3)#%d (0) { +} +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_22_loadextension.phpt Sun Jul 27 00:05:36 2008 @@ -1,27 +1,27 @@ ---TEST-- -SQLite3 load extension ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---INI-- -open_basedir=. -sqlite3.extension_dir=. ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -$directory = dirname(__FILE__); - -touch($directory . '/myext.txt'); - -var_dump($db->loadExtension('myext.txt')); -var_dump($db->close()); -unlink($directory . '/myext.txt'); - -echo "Done\n"; -?> ---EXPECTF-- -Warning: SQLite3::loadExtension(): Unable to load extension at './myext.txt' in %s on line %d -bool(false) -bool(true) -Done +--TEST-- +SQLite3 load extension +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--INI-- +open_basedir=. +sqlite3.extension_dir=. +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +$directory = dirname(__FILE__); + +touch($directory . '/myext.txt'); + +var_dump($db->loadExtension('myext.txt')); +var_dump($db->close()); +unlink($directory . '/myext.txt'); + +echo "Done\n"; +?> +--EXPECTF-- +Warning: SQLite3::loadExtension(): Unable to load extension at './myext.txt' in %s on line %d +bool(false) +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_23_escape_string.phpt Sun Jul 27 00:05:36 2008 @@ -1,51 +1,51 @@ ---TEST-- -SQLite3::escapeString ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", '" . $db->escapeString("test''%") . "')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$results = $db->query("SELECT * FROM test ORDER BY id ASC"); -while ($result = $results->fetchArray(SQLITE3_NUM)) -{ - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(7) "test''%" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::escapeString +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", '" . $db->escapeString("test''%") . "')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$results = $db->query("SELECT * FROM test ORDER BY id ASC"); +while ($result = $results->fetchArray(SQLITE3_NUM)) +{ + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(7) "test''%" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_24_last_insert_rowid.phpt Sun Jul 27 00:05:36 2008 @@ -1,34 +1,34 @@ ---TEST-- -SQLite3::lastInsertRowID tests ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->lastInsertRowID()); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); -var_dump($db->lastInsertRowID()); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -int(1) -bool(true) -int(2) -Closing database -bool(true) -Done +--TEST-- +SQLite3::lastInsertRowID tests +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->lastInsertRowID()); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); +var_dump($db->lastInsertRowID()); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +int(1) +bool(true) +int(2) +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_25_create_aggregate.phpt Sun Jul 27 00:05:36 2008 @@ -1,56 +1,56 @@ ---TEST-- -SQLite3::createAggregate() test ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); - -function sum_list_step(&$context, $string) { - if (empty($context)) - { - $context = array('total' => 0, 'values' => array()); - } - var_dump($context); - $context['total'] += intval($string); - $context['values'][] = $context['total']; - return true; -} - -function sum_list_finalize(&$context) { - var_dump($context); - return implode(',', $context['values']); -} - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (a INTEGER, b INTEGER)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (a, b) VALUES (1, -1)")); -var_dump($db->exec("INSERT INTO test (a, b) VALUES (2, -2)")); -var_dump($db->exec("INSERT INTO test (a, b) VALUES (3, -3)")); -var_dump($db->exec("INSERT INTO test (a, b) VALUES (4, -4)")); -var_dump($db->exec("INSERT INTO test (a, b) VALUES (4, -4)")); - -$db->createAggregate('S', 'sum_list_step', 'sum_list_finalize', 1); - -print_r($db->querySingle("SELECT S(a), S(b) FROM test", true)); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -bool(true) -bool(true) -bool(true) - -Closing database -bool(true) -Done +--TEST-- +SQLite3::createAggregate() test +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); + +function sum_list_step(&$context, $string) { + if (empty($context)) + { + $context = array('total' => 0, 'values' => array()); + } + var_dump($context); + $context['total'] += intval($string); + $context['values'][] = $context['total']; + return true; +} + +function sum_list_finalize(&$context) { + var_dump($context); + return implode(',', $context['values']); +} + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (a INTEGER, b INTEGER)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (a, b) VALUES (1, -1)")); +var_dump($db->exec("INSERT INTO test (a, b) VALUES (2, -2)")); +var_dump($db->exec("INSERT INTO test (a, b) VALUES (3, -3)")); +var_dump($db->exec("INSERT INTO test (a, b) VALUES (4, -4)")); +var_dump($db->exec("INSERT INTO test (a, b) VALUES (4, -4)")); + +$db->createAggregate('S', 'sum_list_step', 'sum_list_finalize', 1); + +print_r($db->querySingle("SELECT S(a), S(b) FROM test", true)); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +bool(true) +bool(true) +bool(true) + +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_26_reset_prepared_stmt.phpt Sun Jul 27 00:05:36 2008 @@ -1,61 +1,61 @@ ---TEST-- -SQLite3::reset prepared statement ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'c'; -echo "BINDING Parameter\n"; -var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); -$foo = 'a'; -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$stmt->reset(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Parameter -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::reset prepared statement +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'c'; +echo "BINDING Parameter\n"; +var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); +$foo = 'a'; +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$stmt->reset(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Parameter +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_27_reset_prepared_stmt_result.phpt Sun Jul 27 00:05:36 2008 @@ -1,61 +1,61 @@ ---TEST-- -SQLite3::reset prepared statement results ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'c'; -echo "BINDING Parameter\n"; -var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); -$foo = 'a'; -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$results->reset(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Parameter -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3::reset prepared statement results +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'c'; +echo "BINDING Parameter\n"; +var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); +$foo = 'a'; +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$results->reset(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Parameter +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +Closing database +bool(true) +Done http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt?r1=1.1.2.1&r2=1.1.2.2&diff_format=u Index: php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt diff -u php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt:1.1.2.1 php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt:1.1.2.2 --- php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt:1.1.2.1 Fri Jul 25 02:44:58 2008 +++ php-src/ext/sqlite3/tests/sqlite3_28_clear_bindings.phpt Sun Jul 27 00:05:36 2008 @@ -1,65 +1,65 @@ ---TEST-- -SQLite3_stmt::clear prepared statement results ---SKIPIF-- -<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> ---FILE-- -<?php - -require_once(dirname(__FILE__) . '/new_db.inc'); -define('TIMENOW', time()); - -echo "Creating Table\n"; -var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); - -echo "INSERT into table\n"; -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); -var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); - -echo "SELECTING results\n"; -$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); -$foo = 'c'; -echo "BINDING Parameter\n"; -var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); -$foo = 'a'; -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$stmt->reset(); -$stmt->clear(); -var_dump($stmt->bindValue(1, 'b', SQLITE3_TEXT)); -$results = $stmt->execute(); -while ($result = $results->fetchArray(SQLITE3_NUM)) { - var_dump($result); -} -$results->finalize(); - -echo "Closing database\n"; -var_dump($db->close()); -echo "Done\n"; -?> ---EXPECTF-- -Creating Table -bool(true) -INSERT into table -bool(true) -bool(true) -SELECTING results -BINDING Parameter -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "a" -} -bool(true) -array(2) { - [0]=> - int(%d) - [1]=> - string(1) "b" -} -Closing database -bool(true) -Done +--TEST-- +SQLite3_stmt::clear prepared statement results +--SKIPIF-- +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> +--FILE-- +<?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo "Creating Table\n"; +var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo "INSERT into table\n"; +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')")); +var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')")); + +echo "SELECTING results\n"; +$stmt = $db->prepare("SELECT * FROM test WHERE id = ? ORDER BY id ASC"); +$foo = 'c'; +echo "BINDING Parameter\n"; +var_dump($stmt->bindParam(1, $foo, SQLITE3_TEXT)); +$foo = 'a'; +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$stmt->reset(); +$stmt->clear(); +var_dump($stmt->bindValue(1, 'b', SQLITE3_TEXT)); +$results = $stmt->execute(); +while ($result = $results->fetchArray(SQLITE3_NUM)) { + var_dump($result); +} +$results->finalize(); + +echo "Closing database\n"; +var_dump($db->close()); +echo "Done\n"; +?> +--EXPECTF-- +Creating Table +bool(true) +INSERT into table +bool(true) +bool(true) +SELECTING results +BINDING Parameter +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "a" +} +bool(true) +array(2) { + [0]=> + int(%d) + [1]=> + string(1) "b" +} +Closing database +bool(true) +Done