diff options
author | SVN Migration <svn@php.net> | 2003-06-18 22:02:29 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2003-06-18 22:02:29 +0000 |
commit | a400da70d39a3c947663830f78878ec5bdc17864 (patch) | |
tree | 7ecb565070571b50ebaafa3851d145dc370af387 /ext/sqlite/tests | |
parent | 4cf62ff62cd37a70bdadce9375f89eefe311d539 (diff) | |
download | php-git-php-4.3.3RC1.tar.gz |
This commit was manufactured by cvs2svn to create tag 'php_4_3_3RC1'.php-4.3.3RC1
Diffstat (limited to 'ext/sqlite/tests')
-rw-r--r-- | ext/sqlite/tests/blankdb.inc | 11 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_001.phpt | 17 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_002.phpt | 31 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_003.phpt | 51 | ||||
-rw-r--r-- | ext/sqlite/tests/sqlite_004.phpt | 46 | ||||
-rw-r--r-- | ext/sqlite/tests/sqlite_005.phpt | 47 | ||||
-rw-r--r-- | ext/sqlite/tests/sqlite_006.phpt | 52 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_007.phpt | 51 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_008.phpt | 43 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_009.phpt | 43 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_010.phpt | 78 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_011.phpt | 27 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_012.phpt | 35 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_013.phpt | 75 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_014.phpt | 118 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_015.phpt | 47 | ||||
-rwxr-xr-x | ext/sqlite/tests/sqlite_016.phpt | 42 |
17 files changed, 0 insertions, 814 deletions
diff --git a/ext/sqlite/tests/blankdb.inc b/ext/sqlite/tests/blankdb.inc deleted file mode 100644 index 085d3b2b51..0000000000 --- a/ext/sqlite/tests/blankdb.inc +++ /dev/null @@ -1,11 +0,0 @@ -<?php #vim:ft=php -$dbname = tempnam(dirname(__FILE__), "phpsql"); -function cleanup() { - if ($GLOBALS['db']) { - sqlite_close($GLOBALS['db']); - } - unlink($GLOBALS['dbname']); -} -register_shutdown_function("cleanup"); -$db = sqlite_open($dbname); -?> diff --git a/ext/sqlite/tests/sqlite_001.phpt b/ext/sqlite/tests/sqlite_001.phpt deleted file mode 100755 index 70059a3e59..0000000000 --- a/ext/sqlite/tests/sqlite_001.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -sqlite: sqlite_open/close ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -require_once('blankdb.inc'); -echo "$db\n"; -sqlite_close($db); -$db = NULL; -echo "Done\n"; -?> ---EXPECTF-- -Resource id #%d -Done diff --git a/ext/sqlite/tests/sqlite_002.phpt b/ext/sqlite/tests/sqlite_002.phpt deleted file mode 100755 index d76b61687d..0000000000 --- a/ext/sqlite/tests/sqlite_002.phpt +++ /dev/null @@ -1,31 +0,0 @@ ---TEST-- -sqlite: Simple insert/select ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -sqlite_query("CREATE TABLE foo(c1 date, c2 time, c3 varchar(64))", $db); -sqlite_query("INSERT INTO foo VALUES ('2002-01-02', '12:49:00', NULL)", $db); -$r = sqlite_query("SELECT * from foo", $db); -var_dump(sqlite_fetch_array($r)); -?> ---EXPECT-- -array(6) { - [0]=> - string(10) "2002-01-02" - ["c1"]=> - string(10) "2002-01-02" - [1]=> - string(8) "12:49:00" - ["c2"]=> - string(8) "12:49:00" - [2]=> - NULL - ["c3"]=> - NULL -} diff --git a/ext/sqlite/tests/sqlite_003.phpt b/ext/sqlite/tests/sqlite_003.phpt deleted file mode 100755 index 3e6cb3f04e..0000000000 --- a/ext/sqlite/tests/sqlite_003.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -sqlite: Simple insert/select, different result represenatation ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -sqlite_query("CREATE TABLE foo(c1 date, c2 time, c3 varchar(64))", $db); -sqlite_query("INSERT INTO foo VALUES ('2002-01-02', '12:49:00', NULL)", $db); -$r = sqlite_query("SELECT * from foo", $db); -var_dump(sqlite_fetch_array($r, SQLITE_BOTH)); -$r = sqlite_query("SELECT * from foo", $db); -var_dump(sqlite_fetch_array($r, SQLITE_NUM)); -$r = sqlite_query("SELECT * from foo", $db); -var_dump(sqlite_fetch_array($r, SQLITE_ASSOC)); -?> ---EXPECT-- -array(6) { - [0]=> - string(10) "2002-01-02" - ["c1"]=> - string(10) "2002-01-02" - [1]=> - string(8) "12:49:00" - ["c2"]=> - string(8) "12:49:00" - [2]=> - NULL - ["c3"]=> - NULL -} -array(3) { - [0]=> - string(10) "2002-01-02" - [1]=> - string(8) "12:49:00" - [2]=> - NULL -} -array(3) { - ["c1"]=> - string(10) "2002-01-02" - ["c2"]=> - string(8) "12:49:00" - ["c3"]=> - NULL -} diff --git a/ext/sqlite/tests/sqlite_004.phpt b/ext/sqlite/tests/sqlite_004.phpt deleted file mode 100644 index 4005fc9030..0000000000 --- a/ext/sqlite/tests/sqlite_004.phpt +++ /dev/null @@ -1,46 +0,0 @@ ---TEST-- -sqlite: binary encoding ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$strings = array( - "hello", - "hello\x01o", - "\x01hello there", - "hello\x00there", - "" -); - -sqlite_query("CREATE TABLE strings(a)", $db); - -foreach ($strings as $str) { - sqlite_query("INSERT INTO strings VALUES('" . sqlite_escape_string($str) . "')", $db); -} - -$i = 0; -$r = sqlite_query("SELECT * from strings", $db); -while ($row = sqlite_fetch_array($r, SQLITE_NUM)) { - if ($row[0] !== $strings[$i]) { - echo "FAIL!\n"; - var_dump($row[0]); - var_dump($strings[$i]); - } else { - echo "OK!\n"; - } - $i++; -} -echo "DONE!\n"; -?> ---EXPECT-- -OK! -OK! -OK! -OK! -OK! -DONE! diff --git a/ext/sqlite/tests/sqlite_005.phpt b/ext/sqlite/tests/sqlite_005.phpt deleted file mode 100644 index 70a8232630..0000000000 --- a/ext/sqlite/tests/sqlite_005.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -sqlite: aggregate functions ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - "one", - "two", - "three" - ); - -sqlite_query("CREATE TABLE strings(a)", $db); - -foreach ($data as $str) { - sqlite_query("INSERT INTO strings VALUES('" . sqlite_escape_string($str) . "')", $db); -} - -function cat_step(&$context, $string) -{ - $context .= $string; -} - -function cat_fin(&$context) -{ - return $context; -} - -sqlite_create_aggregate($db, "cat", "cat_step", "cat_fin"); - -$r = sqlite_query("SELECT cat(a) from strings", $db); -while ($row = sqlite_fetch_array($r, SQLITE_NUM)) { - var_dump($row); -} -echo "DONE!\n"; -?> ---EXPECT-- -array(1) { - [0]=> - string(11) "onetwothree" -} -DONE! diff --git a/ext/sqlite/tests/sqlite_006.phpt b/ext/sqlite/tests/sqlite_006.phpt deleted file mode 100644 index b839a6e5c6..0000000000 --- a/ext/sqlite/tests/sqlite_006.phpt +++ /dev/null @@ -1,52 +0,0 @@ ---TEST-- -sqlite: regular functions ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - array("one", "uno"), - array("two", "dos"), - array("three", "tres"), - ); - -sqlite_query("CREATE TABLE strings(a,b)", $db); - -function implode_args() -{ - $args = func_get_args(); - $sep = array_shift($args); - return implode($sep, $args); -} - -foreach ($data as $row) { - sqlite_query("INSERT INTO strings VALUES('" . sqlite_escape_string($row[0]) . "','" . sqlite_escape_string($row[1]) . "')", $db); -} - -sqlite_create_function($db, "implode", "implode_args"); - -$r = sqlite_query("SELECT implode('-', a, b) from strings", $db); -while ($row = sqlite_fetch_array($r, SQLITE_NUM)) { - var_dump($row); -} -echo "DONE!\n"; -?> ---EXPECT-- -array(1) { - [0]=> - string(7) "one-uno" -} -array(1) { - [0]=> - string(7) "two-dos" -} -array(1) { - [0]=> - string(10) "three-tres" -} -DONE! diff --git a/ext/sqlite/tests/sqlite_007.phpt b/ext/sqlite/tests/sqlite_007.phpt deleted file mode 100755 index c68e165a0c..0000000000 --- a/ext/sqlite/tests/sqlite_007.phpt +++ /dev/null @@ -1,51 +0,0 @@ ---TEST-- -sqlite: Simple insert/select (unbuffered) ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -sqlite_query("CREATE TABLE foo(c1 date, c2 time, c3 varchar(64))", $db); -sqlite_query("INSERT INTO foo VALUES ('2002-01-02', '12:49:00', NULL)", $db); -$r = sqlite_unbuffered_query("SELECT * from foo", $db); -var_dump(sqlite_fetch_array($r, SQLITE_BOTH)); -$r = sqlite_unbuffered_query("SELECT * from foo", $db); -var_dump(sqlite_fetch_array($r, SQLITE_NUM)); -$r = sqlite_unbuffered_query("SELECT * from foo", $db); -var_dump(sqlite_fetch_array($r, SQLITE_ASSOC)); -?> ---EXPECT-- -array(6) { - [0]=> - string(10) "2002-01-02" - ["c1"]=> - string(10) "2002-01-02" - [1]=> - string(8) "12:49:00" - ["c2"]=> - string(8) "12:49:00" - [2]=> - NULL - ["c3"]=> - NULL -} -array(3) { - [0]=> - string(10) "2002-01-02" - [1]=> - string(8) "12:49:00" - [2]=> - NULL -} -array(3) { - ["c1"]=> - string(10) "2002-01-02" - ["c2"]=> - string(8) "12:49:00" - ["c3"]=> - NULL -} diff --git a/ext/sqlite/tests/sqlite_008.phpt b/ext/sqlite/tests/sqlite_008.phpt deleted file mode 100755 index 5886e8f73a..0000000000 --- a/ext/sqlite/tests/sqlite_008.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -sqlite: fetch all (buffered) ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - "one", - "two", - "three" - ); - -sqlite_query("CREATE TABLE strings(a VARCHAR)", $db); - -foreach ($data as $str) { - sqlite_query("INSERT INTO strings VALUES('$str')", $db); -} - -$r = sqlite_query("SELECT a from strings", $db); -while ($row = sqlite_fetch_array($r, SQLITE_NUM)) { - var_dump($row); -} -echo "DONE!\n"; -?> ---EXPECT-- -array(1) { - [0]=> - string(3) "one" -} -array(1) { - [0]=> - string(3) "two" -} -array(1) { - [0]=> - string(5) "three" -} -DONE! diff --git a/ext/sqlite/tests/sqlite_009.phpt b/ext/sqlite/tests/sqlite_009.phpt deleted file mode 100755 index 990b6c68f3..0000000000 --- a/ext/sqlite/tests/sqlite_009.phpt +++ /dev/null @@ -1,43 +0,0 @@ ---TEST-- -sqlite: fetch all (unbuffered) ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - "one", - "two", - "three" - ); - -sqlite_query("CREATE TABLE strings(a VARCHAR)", $db); - -foreach ($data as $str) { - sqlite_query("INSERT INTO strings VALUES('$str')", $db); -} - -$r = sqlite_unbuffered_query("SELECT a from strings", $db); -while ($row = sqlite_fetch_array($r, SQLITE_NUM)) { - var_dump($row); -} -echo "DONE!\n"; -?> ---EXPECT-- -array(1) { - [0]=> - string(3) "one" -} -array(1) { - [0]=> - string(3) "two" -} -array(1) { - [0]=> - string(5) "three" -} -DONE! diff --git a/ext/sqlite/tests/sqlite_010.phpt b/ext/sqlite/tests/sqlite_010.phpt deleted file mode 100755 index 3715747072..0000000000 --- a/ext/sqlite/tests/sqlite_010.phpt +++ /dev/null @@ -1,78 +0,0 @@ ---TEST-- -sqlite: fetch all (iterator) ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - "one", - "two", - "three" - ); - -sqlite_query("CREATE TABLE strings(a VARCHAR)", $db); - -foreach ($data as $str) { - sqlite_query("INSERT INTO strings VALUES('$str')", $db); -} - -$r = sqlite_unbuffered_query("SELECT a from strings", $db); -while (sqlite_has_more($r)) { - var_dump(sqlite_current($r, SQLITE_NUM)); - sqlite_next($r); -} -$r = sqlite_query("SELECT a from strings", $db); -while (sqlite_has_more($r)) { - var_dump(sqlite_current($r, SQLITE_NUM)); - sqlite_next($r); -} -sqlite_rewind($r); -while (sqlite_has_more($r)) { - var_dump(sqlite_current($r, SQLITE_NUM)); - sqlite_next($r); -} -echo "DONE!\n"; -?> ---EXPECT-- -array(1) { - [0]=> - string(3) "one" -} -array(1) { - [0]=> - string(3) "two" -} -array(1) { - [0]=> - string(5) "three" -} -array(1) { - [0]=> - string(3) "one" -} -array(1) { - [0]=> - string(3) "two" -} -array(1) { - [0]=> - string(5) "three" -} -array(1) { - [0]=> - string(3) "one" -} -array(1) { - [0]=> - string(3) "two" -} -array(1) { - [0]=> - string(5) "three" -} -DONE! diff --git a/ext/sqlite/tests/sqlite_011.phpt b/ext/sqlite/tests/sqlite_011.phpt deleted file mode 100755 index 1aa6704249..0000000000 --- a/ext/sqlite/tests/sqlite_011.phpt +++ /dev/null @@ -1,27 +0,0 @@ ---TEST-- -sqlite: returned associative column names ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -sqlite_query("CREATE TABLE foo (c1 char, c2 char, c3 char)", $db); -sqlite_query("CREATE TABLE bar (c1 char, c2 char, c3 char)", $db); -sqlite_query("INSERT INTO foo VALUES ('1', '2', '3')", $db); -sqlite_query("INSERT INTO bar VALUES ('4', '5', '6')", $db); -$r = sqlite_query("SELECT * from foo, bar", $db, SQLITE_ASSOC); -var_dump(sqlite_fetch_array($r)); -?> ---EXPECT-- -array(3) { - ["c1"]=> - string(1) "4" - ["c2"]=> - string(1) "5" - ["c3"]=> - string(1) "6" -} diff --git a/ext/sqlite/tests/sqlite_012.phpt b/ext/sqlite/tests/sqlite_012.phpt deleted file mode 100755 index 531bf8055b..0000000000 --- a/ext/sqlite/tests/sqlite_012.phpt +++ /dev/null @@ -1,35 +0,0 @@ ---TEST-- -sqlite: read field names ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -sqlite_query("CREATE TABLE strings(foo VARCHAR, bar VARCHAR, baz VARCHAR)", $db); - -echo "Buffered\n"; -$r = sqlite_query("SELECT * from strings", $db); -for($i=0; $i<sqlite_num_fields($r); $i++) { - var_dump(sqlite_field_name($r, $i)); -} -echo "Unbuffered\n"; -$r = sqlite_unbuffered_query("SELECT * from strings", $db); -for($i=0; $i<sqlite_num_fields($r); $i++) { - var_dump(sqlite_field_name($r, $i)); -} -echo "DONE!\n"; -?> ---EXPECT-- -Buffered -string(3) "foo" -string(3) "bar" -string(3) "baz" -Unbuffered -string(3) "foo" -string(3) "bar" -string(3) "baz" -DONE! diff --git a/ext/sqlite/tests/sqlite_013.phpt b/ext/sqlite/tests/sqlite_013.phpt deleted file mode 100755 index a9f2ae5dad..0000000000 --- a/ext/sqlite/tests/sqlite_013.phpt +++ /dev/null @@ -1,75 +0,0 @@ ---TEST-- -sqlite: fetch column ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - array (0 => 'one', 1 => 'two'), - array (0 => 'three', 1 => 'four') - ); - -sqlite_query("CREATE TABLE strings(a VARCHAR, b VARCHAR)", $db); - -foreach ($data as $str) { - sqlite_query("INSERT INTO strings VALUES('${str[0]}','${str[1]}')", $db); -} - -echo "====BUFFERED====\n"; -$r = sqlite_query("SELECT a, b from strings", $db); -while (sqlite_has_more($r)) { - var_dump(sqlite_current($r, SQLITE_NUM)); - var_dump(sqlite_column($r, 0)); - var_dump(sqlite_column($r, 1)); - var_dump(sqlite_column($r, 'a')); - var_dump(sqlite_column($r, 'b')); - sqlite_next($r); -} -echo "====UNBUFFERED====\n"; -$r = sqlite_unbuffered_query("SELECT a, b from strings", $db); -while (sqlite_has_more($r)) { - var_dump(sqlite_column($r, 0)); - var_dump(sqlite_column($r, 'b')); - var_dump(sqlite_column($r, 1)); - var_dump(sqlite_column($r, 'a')); - sqlite_next($r); -} -echo "DONE!\n"; -?> ---EXPECT-- -====BUFFERED==== -array(2) { - [0]=> - string(3) "one" - [1]=> - string(3) "two" -} -string(3) "one" -string(3) "two" -string(3) "one" -string(3) "two" -array(2) { - [0]=> - string(5) "three" - [1]=> - string(4) "four" -} -string(5) "three" -string(4) "four" -string(5) "three" -string(4) "four" -====UNBUFFERED==== -string(3) "one" -string(3) "two" -NULL -NULL -string(5) "three" -string(4) "four" -NULL -NULL -DONE! diff --git a/ext/sqlite/tests/sqlite_014.phpt b/ext/sqlite/tests/sqlite_014.phpt deleted file mode 100755 index 9e847958b0..0000000000 --- a/ext/sqlite/tests/sqlite_014.phpt +++ /dev/null @@ -1,118 +0,0 @@ ---TEST-- -sqlite: fetch all (fetch_all) ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - "one", - "two", - "three" - ); - -sqlite_query("CREATE TABLE strings(a VARCHAR)", $db); - -foreach ($data as $str) { - sqlite_query("INSERT INTO strings VALUES('$str')", $db); -} - -echo "unbuffered twice\n"; -$r = sqlite_unbuffered_query("SELECT a from strings", $db, SQLITE_NUM); -var_dump(sqlite_fetch_all($r)); -var_dump(sqlite_fetch_all($r)); - -echo "unbuffered with fetch_array\n"; -$r = sqlite_unbuffered_query("SELECT a from strings", $db, SQLITE_NUM); -var_dump(sqlite_fetch_array($r)); -var_dump(sqlite_fetch_all($r)); - -echo "buffered\n"; -$r = sqlite_query("SELECT a from strings", $db, SQLITE_NUM); -var_dump(sqlite_fetch_all($r)); -var_dump(sqlite_fetch_array($r)); -var_dump(sqlite_fetch_all($r)); - -echo "DONE!\n"; -?> ---EXPECTF-- -unbuffered twice -array(3) { - [0]=> - array(1) { - [0]=> - string(3) "one" - } - [1]=> - array(1) { - [0]=> - string(3) "two" - } - [2]=> - array(1) { - [0]=> - string(5) "three" - } -} - -Notice: sqlite_fetch_all(): One or more rowsets were already returned in %ssqlite_014.php on line %d -array(0) { -} -unbuffered with fetch_array -array(1) { - [0]=> - string(3) "one" -} -array(2) { - [0]=> - array(1) { - [0]=> - string(3) "two" - } - [1]=> - array(1) { - [0]=> - string(5) "three" - } -} -buffered -array(3) { - [0]=> - array(1) { - [0]=> - string(3) "one" - } - [1]=> - array(1) { - [0]=> - string(3) "two" - } - [2]=> - array(1) { - [0]=> - string(5) "three" - } -} -bool(false) -array(3) { - [0]=> - array(1) { - [0]=> - string(3) "one" - } - [1]=> - array(1) { - [0]=> - string(3) "two" - } - [2]=> - array(1) { - [0]=> - string(5) "three" - } -} -DONE! diff --git a/ext/sqlite/tests/sqlite_015.phpt b/ext/sqlite/tests/sqlite_015.phpt deleted file mode 100755 index b5bd6172c8..0000000000 --- a/ext/sqlite/tests/sqlite_015.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -sqlite: fetch all (array_query) ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - "one", - "two", - "three" - ); - -sqlite_query("CREATE TABLE strings(a VARCHAR)", $db); - -foreach ($data as $str) { - sqlite_query("INSERT INTO strings VALUES('$str')", $db); -} - -$res = sqlite_array_query("SELECT a from strings", $db, SQLITE_NUM); -var_dump($res); - -echo "DONE!\n"; -?> ---EXPECTF-- -array(3) { - [0]=> - array(1) { - [0]=> - string(3) "one" - } - [1]=> - array(1) { - [0]=> - string(3) "two" - } - [2]=> - array(1) { - [0]=> - string(5) "three" - } -} -DONE! diff --git a/ext/sqlite/tests/sqlite_016.phpt b/ext/sqlite/tests/sqlite_016.phpt deleted file mode 100755 index 8df7dc9a12..0000000000 --- a/ext/sqlite/tests/sqlite_016.phpt +++ /dev/null @@ -1,42 +0,0 @@ ---TEST-- -sqlite: fetch string ---INI-- -sqlite.assoc_case=0 ---SKIPIF-- -<?php # vim:ft=php -if (!extension_loaded("sqlite")) print "skip"; ?> ---FILE-- -<?php -include "blankdb.inc"; - -$data = array( - array (0 => 'one', 1 => 'two'), - array (0 => 'three', 1 => 'four') - ); - -sqlite_query("CREATE TABLE strings(a VARCHAR, b VARCHAR)", $db); - -foreach ($data as $str) { - sqlite_query("INSERT INTO strings VALUES('${str[0]}','${str[1]}')", $db); -} - -echo "====BUFFERED====\n"; -$r = sqlite_query("SELECT a, b from strings", $db); -while (sqlite_has_more($r)) { - var_dump(sqlite_fetch_string($r)); -} -echo "====UNBUFFERED====\n"; -$r = sqlite_unbuffered_query("SELECT a, b from strings", $db); -while (sqlite_has_more($r)) { - var_dump(sqlite_fetch_string($r)); -} -echo "DONE!\n"; -?> ---EXPECT-- -====BUFFERED==== -string(3) "one" -string(5) "three" -====UNBUFFERED==== -string(3) "one" -string(5) "three" -DONE! |