/**
  * @test
  */
 function iteration()
 {
     $reader = new XMLReaderStub('<r><a>1</a><a>2</a></r>');
     $it = new XMLReaderIterator($reader);
     $this->assertSame(null, $it->valid());
     $it->rewind();
     $this->assertSame(true, $it->valid());
     $node = $it->current();
     $this->assertEquals('r', $node->getName());
     $this->assertEquals('12', (string) $node);
     $it->moveToNextElementByName('a');
     $node = $it->current();
     $this->assertEquals('a', $node->getName());
     $this->assertEquals('1', (string) $node);
     $it->moveToNextElementByName('a');
     $node = $it->current();
     $this->assertEquals('a', $node->getName());
     $this->assertEquals('2', (string) $node);
     $it->next();
     $it->next();
     $this->assertEquals(XMLReader::END_ELEMENT, $reader->nodeType);
     $this->assertEquals('a', $it->current()->getName());
     $it->next();
     $it->next();
     $this->assertEquals(false, $it->valid());
 }