Skip to content

Commit

Permalink
Add broken test for merging link information from several elements
Browse files Browse the repository at this point in the history
  • Loading branch information
Zegnat committed Mar 22, 2018
1 parent 6b0232b commit ebffee4
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/Mf2/RelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,16 @@ public function testRelURLsRelsUniqueAndSorted() {
$this->assertEquals($output['rel-urls']['#']['rels'], ['archived', 'bookmark', 'me']);
}

public function testRelURLsInfoMergesCorrectly() {
$input = '<a href="#" rel="a">This nodeValue</a>
<a href="#" rel="a" hreflang="en">Not this nodeValue</a>';
$parser = new Parser($input);
$output = $parser->parse();
$this->assertEquals($output['rel-urls']['#']['hreflang'], 'en');
$this->assertArrayNotHasKey('media', $output['rel-urls']['#']);
$this->assertArrayNotHasKey('title', $output['rel-urls']['#']);
$this->assertArrayNotHasKey('type', $output['rel-urls']['#']);
$this->assertEquals($output['rel-urls']['#']['text'], 'This nodeValue');
}

}

0 comments on commit ebffee4

Please # to comment.