Skip to content

Commit

Permalink
Add XMLParserLargeFileTest::testIterateByNodeContent() test case
Browse files Browse the repository at this point in the history
  • Loading branch information
macbre committed Aug 11, 2023
1 parent 11a6962 commit 6c2d331
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/XMLParserLargeFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,20 @@ public function testParsesTheUrls(): void
$this->assertCount(1857, $locations);
$this->assertEquals(1857, $urlTagsCounter);
}

public function testIterateByNodeContent()
{
$cnt = 0;

// <url><loc>https://sklepzamel.com/produkt/sonda-temperatury-ntc-03/</loc></url>
foreach($this->getParser()->iterateByNodeContent(name: 'loc') as $node) {
$this->assertInstanceOf(XMLNodeContent::class, $node);
$this->assertEquals('loc', $node->name);
$this->assertStringStartsWith('http', $node->content);

$cnt++;
}

$this->assertEquals(1857, $cnt);
}
}

0 comments on commit 6c2d331

Please sign in to comment.