Always show handler used

This commit is contained in:
Marcus Boerger 2002-11-01 14:21:36 +00:00
parent 5ab8fb4df1
commit d50e62cbac
7 changed files with 29 additions and 13 deletions

View File

@ -7,12 +7,14 @@ DBA File Creation Test
--FILE--
<?php
require_once('test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created with $handler.\n";
echo "database file created\n";
dba_close($db_file);
} else {
echo "$db_file does not exist\n";
}
dba_close($db_file);
?>
--EXPECTF--
database file created with %s.
database handler: %s
database file created

View File

@ -7,6 +7,7 @@ DBA Insert/Fetch Test
--FILE--
<?php
require_once('test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "This is a test insert", $db_file);
echo dba_fetch("key1", $db_file);
@ -15,5 +16,6 @@ DBA Insert/Fetch Test
echo "Error creating database\n";
}
?>
--EXPECT--
--EXPECTF--
database handler: %s
This is a test insert

View File

@ -7,6 +7,7 @@ DBA Insert/Replace/Fetch Test
--FILE--
<?php
require_once('test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "This is a test insert", $db_file);
dba_replace("key1", "This is the replacement text", $db_file);
@ -17,5 +18,6 @@ DBA Insert/Replace/Fetch Test
echo "Error creating database\n";
}
?>
--EXPECT--
--EXPECTF--
database handler: %s
This is the replacement text

View File

@ -7,6 +7,7 @@ DBA Multiple Insert/Fetch Test
--FILE--
<?php
require_once('test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
dba_insert("key2", "Content String 2", $db_file);
@ -21,5 +22,6 @@ DBA Multiple Insert/Fetch Test
echo "Error creating database\n";
}
?>
--EXPECT--
--EXPECTF--
database handler: %s
Another Content String Content String 2

View File

@ -7,6 +7,7 @@ DBA FirstKey/NextKey Loop Test With 5 Items
--FILE--
<?php
require_once('test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
dba_insert("key2", "Content String 2", $db_file);
@ -28,5 +29,6 @@ DBA FirstKey/NextKey Loop Test With 5 Items
echo "Error creating database\n";
}
?>
--EXPECT--
--EXPECTF--
database handler: %s
5YYYYY

View File

@ -7,6 +7,7 @@ DBA FirstKey/NextKey with 2 deletes
--FILE--
<?php
require_once('test.inc');
echo "database handler: $handler\n";
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
dba_insert("key1", "Content String 1", $db_file);
dba_insert("key2", "Content String 2", $db_file);
@ -30,5 +31,6 @@ DBA FirstKey/NextKey with 2 deletes
echo "Error creating database\n";
}
?>
--EXPECT--
--EXPECTF--
database handler: %s
3NYNYY

View File

@ -8,20 +8,21 @@ DBA Multiple File Creation Test
--FILE--
<?php
require_once('test.inc');
echo "database handler: $handler\n";
$db_file1 = dirname(__FILE__).'/test1.dbm';
$db_file2 = dirname(__FILE__).'/test2.dbm';
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created with $handler.\n";
echo "database file created\n";
} else {
echo "$db_file does not exist\n";
}
if (($db_file1=dba_open($db_file1, "n", $handler))!==FALSE) {
echo "database file created with $handler.\n";
echo "database file created\n";
} else {
echo "$db_file does not exist\n";
}
if (($db_file2=dba_open($db_file2, "n", $handler))!==FALSE) {
echo "database file created with $handler.\n";
echo "database file created\n";
} else {
echo "$db_file does not exist\n";
}
@ -29,10 +30,13 @@ DBA Multiple File Creation Test
dba_close($db_file);
?>
--EXPECTF--
database file created with %s.
database handler: %s
database file created
database file created
database file created
array(3) {
[%d]=>
string(%d) "%sext/dba/tests/test.dbm"
string(%d) "%sext/dba/tests/test0.dbm"
[%d]=>
string(%d) "%sext/dba/tests/test1.dbm"
[%d]=>