X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fbookmark%2FLinkUtilsTest.php;h=ddab4e3caebd0e7070273738054f9f58d0821aa0;hb=d9d71b10c3bc70a0881d630b37dc4e918c9e812f;hp=c2f9f9305716829b91ba6ffe36cfc9a8a29cb80e;hpb=8a1ce1da15fdbae99b24700b06f2008c7a657603;p=github%2Fshaarli%2FShaarli.git diff --git a/tests/bookmark/LinkUtilsTest.php b/tests/bookmark/LinkUtilsTest.php index c2f9f930..ddab4e3c 100644 --- a/tests/bookmark/LinkUtilsTest.php +++ b/tests/bookmark/LinkUtilsTest.php @@ -168,6 +168,36 @@ class LinkUtilsTest extends TestCase $this->assertEquals($description, html_extract_tag('description', $html)); } + /** + * Test html_extract_tag() with double quoted content containing single quote, and the opposite. + */ + public function testHtmlExtractExistentNameTagWithMixedQuotes(): void + { + $description = 'Bob and Alice share M&M\'s.'; + + $html = ''; + $this->assertEquals($description, html_extract_tag('description', $html)); + + $html = ''; + $this->assertEquals($description, html_extract_tag('description', $html)); + + $html = ''; + $this->assertEquals($description, html_extract_tag('description', $html)); + + $description = 'Bob and Alice share "cookies".'; + + $html = ''; + $this->assertEquals($description, html_extract_tag('description', $html)); + + $html = ''; + $this->assertEquals($description, html_extract_tag('description', $html)); + + $html = ''; + $this->assertEquals($description, html_extract_tag('description', $html)); + } + /** * Test html_extract_tag() when the tag