Annotation of embedaddon/php/ext/spl/tests/fileobject_002.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: SPL: SplFileObject::fgetc
                      3: --FILE--
                      4: <?php
                      5: 
                      6: function test($name)
                      7: {
                      8:        echo "===$name===\n";
                      9: 
                     10:        $o = new SplFileObject(dirname(__FILE__) . '/' . $name);
                     11: 
                     12:        var_dump($o->key());
                     13:        while(($c = $o->fgetc()) !== false)
                     14:        {
                     15:                var_dump($o->key(), $c, $o->eof());
                     16:        }
                     17:        echo "===EOF?===\n";
                     18:        var_dump($o->eof());
                     19:        var_dump($o->key());
                     20:        var_dump($o->eof());
                     21: }
                     22: 
                     23: test('fileobject_001a.txt');
                     24: test('fileobject_001b.txt');
                     25: 
                     26: ?>
                     27: ===DONE===
                     28: <?php exit(0); ?>
                     29: --EXPECT--
                     30: ===fileobject_001a.txt===
                     31: int(0)
                     32: int(0)
                     33: string(1) "0"
                     34: bool(false)
                     35: int(1)
                     36: string(1) "
                     37: "
                     38: bool(false)
                     39: int(1)
                     40: string(1) "1"
                     41: bool(false)
                     42: int(2)
                     43: string(1) "
                     44: "
                     45: bool(false)
                     46: int(2)
                     47: string(1) "2"
                     48: bool(false)
                     49: int(3)
                     50: string(1) "
                     51: "
                     52: bool(false)
                     53: int(3)
                     54: string(1) "3"
                     55: bool(false)
                     56: int(4)
                     57: string(1) "
                     58: "
                     59: bool(false)
                     60: int(4)
                     61: string(1) "4"
                     62: bool(false)
                     63: int(5)
                     64: string(1) "
                     65: "
                     66: bool(false)
                     67: int(5)
                     68: string(1) "5"
                     69: bool(false)
                     70: int(6)
                     71: string(1) "
                     72: "
                     73: bool(false)
                     74: ===EOF?===
                     75: bool(true)
                     76: int(6)
                     77: bool(true)
                     78: ===fileobject_001b.txt===
                     79: int(0)
                     80: int(0)
                     81: string(1) "0"
                     82: bool(false)
                     83: int(1)
                     84: string(1) "
                     85: "
                     86: bool(false)
                     87: int(1)
                     88: string(1) "1"
                     89: bool(false)
                     90: int(2)
                     91: string(1) "
                     92: "
                     93: bool(false)
                     94: int(2)
                     95: string(1) "2"
                     96: bool(false)
                     97: int(3)
                     98: string(1) "
                     99: "
                    100: bool(false)
                    101: int(3)
                    102: string(1) "3"
                    103: bool(false)
                    104: int(4)
                    105: string(1) "
                    106: "
                    107: bool(false)
                    108: int(4)
                    109: string(1) "4"
                    110: bool(false)
                    111: int(5)
                    112: string(1) "
                    113: "
                    114: bool(false)
                    115: int(5)
                    116: string(1) "5"
                    117: bool(false)
                    118: ===EOF?===
                    119: bool(true)
                    120: int(5)
                    121: bool(true)
                    122: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>