예제 #1
0
 public function testIteration()
 {
     $listing = array('a', 'b', 'c');
     $iterator = new DirectoryBuffer($listing);
     $i = 0;
     while ($iterator->valid()) {
         $this->assertEquals($listing[$i], $iterator->current());
         $this->assertEquals($i, $iterator->key());
         $i++;
         $iterator->next();
     }
     $this->assertEquals(count($listing), $i);
     $iterator->rewind();
     $this->assertEquals(reset($listing), $iterator->current());
     $this->assertEquals(key($listing), $iterator->key());
 }
예제 #2
0
 /**
  * streamWrapper::dir_rewinddir — Rewind directory handle
  *
  * @return  boolean     Returns TRUE on success or FALSE on failure.
  */
 public function dir_rewinddir()
 {
     $this->dirBuffer->rewind();
     return true;
 }