From ebffee46d2e8c59d8b2ed95e2e5364f39051b590 Mon Sep 17 00:00:00 2001 From: Martijn van der Ven Date: Thu, 22 Mar 2018 10:03:21 +0100 Subject: [PATCH] Add broken test for merging link information from several elements --- tests/Mf2/RelTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/Mf2/RelTest.php b/tests/Mf2/RelTest.php index 717d27e..30803cc 100644 --- a/tests/Mf2/RelTest.php +++ b/tests/Mf2/RelTest.php @@ -188,4 +188,16 @@ public function testRelURLsRelsUniqueAndSorted() { $this->assertEquals($output['rel-urls']['#']['rels'], ['archived', 'bookmark', 'me']); } + public function testRelURLsInfoMergesCorrectly() { + $input = 'This nodeValue +Not this nodeValue'; + $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'); + } + }