helly Fri Oct 25 07:09:01 2002 EDT
Added files:
/php4/ext/dba/tests dba001.phpt dba002.phpt dba003.phpt dba004.phpt
dba005.phpt dba006.phpt dba007.phpt
Removed files:
/php4/ext/dba/tests 001.phpt 002.phpt 003.phpt 004.phpt 005.phpt
006.phpt 007.phpt
Log:
New naming scheme
Index: php4/ext/dba/tests/dba001.phpt
+++ php4/ext/dba/tests/dba001.phpt
--TEST--
DBA File Creation Test
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
require_once('test.inc');
if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
echo "database file created with $handler.\n";
} else {
echo "$db_file does not exist\n";
}
dba_close($db_file);
?>
--EXPECTF--
database file created with %s.
Index: php4/ext/dba/tests/dba002.phpt
+++ php4/ext/dba/tests/dba002.phpt
--TEST--
DBA Insert/Fetch Test
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
require_once('test.inc');
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);
dba_close($db_file);
} else {
echo "Error creating database\n";
}
?>
--EXPECT--
This is a test insert
Index: php4/ext/dba/tests/dba003.phpt
+++ php4/ext/dba/tests/dba003.phpt
--TEST--
DBA Insert/Replace/Fetch Test
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
require_once('test.inc');
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);
$a = dba_fetch("key1", $db_file);
dba_close($db_file);
echo $a;
} else {
echo "Error creating database\n";
}
?>
--EXPECT--
This is the replacement text
Index: php4/ext/dba/tests/dba004.phpt
+++ php4/ext/dba/tests/dba004.phpt
--TEST--
DBA Multiple Insert/Fetch Test
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
require_once('test.inc');
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);
dba_insert("key3", "Third Content String", $db_file);
dba_insert("key4", "Another Content String", $db_file);
dba_insert("key5", "The last content string", $db_file);
$a = dba_fetch("key4", $db_file);
$b = dba_fetch("key2", $db_file);
dba_close($db_file);
echo "$a $b";
} else {
echo "Error creating database\n";
}
?>
--EXPECT--
Another Content String Content String 2
Index: php4/ext/dba/tests/dba005.phpt
+++ php4/ext/dba/tests/dba005.phpt
--TEST--
DBA FirstKey/NextKey Loop Test With 5 Items
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
require_once('test.inc');
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);
dba_insert("key3", "Third Content String", $db_file);
dba_insert("key4", "Another Content String", $db_file);
dba_insert("key5", "The last content string", $db_file);
$a = dba_firstkey($db_file);
$i=0;
while($a) {
$a = dba_nextkey($db_file);
$i++;
}
echo $i;
for ($i=1; $i<6; $i++) {
echo dba_exists("key$i", $db_file) ? "Y" : "N";
}
dba_close($db_file);
} else {
echo "Error creating database\n";
}
?>
--EXPECT--
5YYYYY
Index: php4/ext/dba/tests/dba006.phpt
+++ php4/ext/dba/tests/dba006.phpt
--TEST--
DBA FirstKey/NextKey with 2 deletes
--SKIPIF--
<?php
require_once('skipif.inc');
?>
--FILE--
<?php
require_once('test.inc');
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);
dba_insert("key3", "Third Content String", $db_file);
dba_insert("key4", "Another Content String", $db_file);
dba_insert("key5", "The last content string", $db_file);
dba_delete("key3", $db_file);
dba_delete("key1", $db_file);
$a = dba_firstkey($db_file);
$i=0;
while($a) {
$a = dba_nextkey($db_file);
$i++;
}
echo $i;
for ($i=1; $i<6; $i++) {
echo dba_exists("key$i", $db_file) ? "Y" : "N";
}
dba_close($db_file);
} else {
echo "Error creating database\n";
}
?>
--EXPECT--
3NYNYY
Index: php4/ext/dba/tests/dba007.phpt
+++ php4/ext/dba/tests/dba007.phpt
--TEST--
DBA Multiple File Creation Test
--SKIPIF--
<?php
require_once('skipif.inc');
if (!function_exists('dba_list')) die('skip dba_list() not available');
?>
--FILE--
<?php
require_once('test.inc');
$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";
} 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";
} 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";
} else {
echo "$db_file does not exist\n";
}
var_dump(dba_list());
dba_close($db_file);
?>
--EXPECTF--
database file created with %s.
array(3) {
[%d]=>
string(%d) "%sext/dba/tests/test.dbm"
[%d]=>
string(%d) "%sext/dba/tests/test1.dbm"
[%d]=>
string(%d) "%sext/dba/tests/test2.dbm"
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php