Annotation of embedaddon/php/ext/sqlite3/tests/sqlite3result_numcolumns_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: SQLite3Result::numColumns parameters
! 3: --CREDITS--
! 4: Jachim Coudenys
! 5: # TestFest 2009 Belgium
! 6: --SKIPIF--
! 7: <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
! 8: --FILE--
! 9: <?php
! 10: $db = new SQLite3(':memory:');
! 11: echo 'Creating Table' . PHP_EOL;
! 12: var_dump($db->exec('CREATE TABLE test (time INTEGER, id STRING)'));
! 13:
! 14: echo 'Inserting data' . PHP_EOL;
! 15: var_dump($db->exec('INSERT INTO test (time, id) VALUES(2, 1)'));
! 16:
! 17: echo 'Fetching number of columns' . PHP_EOL;
! 18: $result = $db->query('SELECT id FROM test');
! 19: var_dump($result->numColumns('time'));
! 20:
! 21: echo 'Done';
! 22:
! 23: ?>
! 24: --EXPECTF--
! 25: Creating Table
! 26: bool(true)
! 27: Inserting data
! 28: bool(true)
! 29: Fetching number of columns
! 30:
! 31: Warning: SQLite3Result::numColumns() expects exactly 0 parameters, 1 given in %s on line %d
! 32: NULL
! 33: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>