Annotation of embedaddon/php/ext/sqlite3/tests/sqlite3_18_changes.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SQLite3::changes() tests
! 3: --SKIPIF--
! 4: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
! 5: --FILE--
! 6: <?php
! 7:
! 8: require_once(dirname(__FILE__) . '/new_db.inc');
! 9: define('TIMENOW', time());
! 10:
! 11: echo "Creating Table\n";
! 12: var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)'));
! 13:
! 14: echo "INSERT into table\n";
! 15: var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'a')"));
! 16: var_dump($db->exec("INSERT INTO test (time, id) VALUES (" . TIMENOW . ", 'b')"));
! 17:
! 18: echo "UPDATE query\n";
! 19: var_dump($db->exec("UPDATE test SET id = 'c'"));
! 20:
! 21: echo "Rows Updated\n";
! 22: var_dump($db->changes());
! 23:
! 24: echo "Closing database\n";
! 25: var_dump($db->close());
! 26: echo "Done\n";
! 27: ?>
! 28: --EXPECTF--
! 29: Creating Table
! 30: bool(true)
! 31: INSERT into table
! 32: bool(true)
! 33: bool(true)
! 34: UPDATE query
! 35: bool(true)
! 36: Rows Updated
! 37: int(2)
! 38: Closing database
! 39: bool(true)
! 40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>