Skip to content

Commit ebffee4

Browse files
committed
Add broken test for merging link information from several elements
1 parent 6b0232b commit ebffee4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/Mf2/RelTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,4 +188,16 @@ public function testRelURLsRelsUniqueAndSorted() {
188188
$this->assertEquals($output['rel-urls']['#']['rels'], ['archived', 'bookmark', 'me']);
189189
}
190190

191+
public function testRelURLsInfoMergesCorrectly() {
192+
$input = '<a href="#" rel="a">This nodeValue</a>
193+
<a href="#" rel="a" hreflang="en">Not this nodeValue</a>';
194+
$parser = new Parser($input);
195+
$output = $parser->parse();
196+
$this->assertEquals($output['rel-urls']['#']['hreflang'], 'en');
197+
$this->assertArrayNotHasKey('media', $output['rel-urls']['#']);
198+
$this->assertArrayNotHasKey('title', $output['rel-urls']['#']);
199+
$this->assertArrayNotHasKey('type', $output['rel-urls']['#']);
200+
$this->assertEquals($output['rel-urls']['#']['text'], 'This nodeValue');
201+
}
202+
191203
}

0 commit comments

Comments
 (0)