X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Fbookmark%2FLinkUtilsTest.php;h=ddab4e3caebd0e7070273738054f9f58d0821aa0;hb=d9d71b10c3bc70a0881d630b37dc4e918c9e812f;hp=25fb30435c8ef09c91623f6b416c1b6300ff459e;hpb=c3a04e328f2c8d40890b0b26b118a193110634ce;p=github%2Fshaarli%2FShaarli.git
diff --git a/tests/bookmark/LinkUtilsTest.php b/tests/bookmark/LinkUtilsTest.php
index 25fb3043..ddab4e3c 100644
--- a/tests/bookmark/LinkUtilsTest.php
+++ b/tests/bookmark/LinkUtilsTest.php
@@ -2,14 +2,14 @@
namespace Shaarli\Bookmark;
-use ReferenceLinkDB;
+use Shaarli\TestCase;
require_once 'tests/utils/CurlUtils.php';
/**
* Class LinkUtilsTest.
*/
-class LinkUtilsTest extends \PHPUnit\Framework\TestCase
+class LinkUtilsTest extends TestCase
{
/**
* Test html_extract_title() when the title is found.
@@ -42,6 +42,19 @@ class LinkUtilsTest extends \PHPUnit\Framework\TestCase
$this->assertEquals(strtolower($charset), header_extract_charset($headers));
}
+ /**
+ * Test headers_extract_charset() when the charset is found with odd quotes.
+ */
+ public function testHeadersExtractExistentCharsetWithQuotes()
+ {
+ $charset = 'x-MacCroatian';
+ $headers = 'text/html; charset="' . $charset . '"otherstuff="test"';
+ $this->assertEquals(strtolower($charset), header_extract_charset($headers));
+
+ $headers = 'text/html; charset=\'' . $charset . '\'otherstuff="test"';
+ $this->assertEquals(strtolower($charset), header_extract_charset($headers));
+ }
+
/**
* Test headers_extract_charset() when the charset is not found.
*/
@@ -76,143 +89,431 @@ class LinkUtilsTest extends \PHPUnit\Framework\TestCase
}
/**
- * Test the download callback with valid value
+ * Test html_extract_tag() when the tag stuff2