~ubuntu-branches/ubuntu/hardy/php5/hardy-updates

« back to all changes in this revision

Viewing changes to ext/dba/tests/dba006.phpt

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-10-09 03:14:32 UTC
  • Revision ID: james.westby@ubuntu.com-20051009031432-kspik3lobxstafv9
Tags: upstream-5.0.5
ImportĀ upstreamĀ versionĀ 5.0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--TEST--
 
2
DBA FirstKey/NextKey with 2 deletes
 
3
--SKIPIF--
 
4
<?php 
 
5
        require_once('skipif.inc');
 
6
        die("info $HND handler used");
 
7
?>
 
8
--FILE--
 
9
<?php
 
10
        require_once('test.inc');
 
11
        echo "database handler: $handler\n";
 
12
        if (($db_file=dba_open($db_file, "n", $handler))!==FALSE) {
 
13
                dba_insert("key1", "Content String 1", $db_file);
 
14
                dba_insert("key2", "Content String 2", $db_file);
 
15
                dba_insert("key3", "Third Content String", $db_file);
 
16
                dba_insert("key4", "Another Content String", $db_file);
 
17
                dba_insert("key5", "The last content string", $db_file);
 
18
                dba_delete("key3", $db_file);
 
19
                dba_delete("key1", $db_file);
 
20
                $a = dba_firstkey($db_file);
 
21
                $i=0;
 
22
                while($a) {
 
23
                        $a = dba_nextkey($db_file);
 
24
                        $i++;
 
25
                }
 
26
                echo $i;
 
27
                for ($i=1; $i<6; $i++) {
 
28
                        echo dba_exists("key$i", $db_file) ? "Y" : "N";
 
29
                }
 
30
                dba_close($db_file);
 
31
        } else {
 
32
                echo "Error creating database\n";
 
33
        }
 
34
?>
 
35
--EXPECTF--
 
36
database handler: %s
 
37
3NYNYY
 
 
b'\\ No newline at end of file'