Ejemplo n.º 1
0
 public function testManualIterator()
 {
     $message = new Message(array('file' => $this->_file));
     $this->assertTrue($message->valid());
     $this->assertEquals($message->getChildren(), $message->current());
     $this->assertEquals($message->key(), 1);
     $message->next();
     $this->assertTrue($message->valid());
     $this->assertEquals($message->getChildren(), $message->current());
     $this->assertEquals($message->key(), 2);
     $message->next();
     $this->assertFalse($message->valid());
     $message->rewind();
     $this->assertTrue($message->valid());
     $this->assertEquals($message->getChildren(), $message->current());
     $this->assertEquals($message->key(), 1);
 }