X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fbookmark%2FLinkUtilsTest.php;h=c2f9f9305716829b91ba6ffe36cfc9a8a29cb80e;hb=b3bd8c3e8d367975980043e772f7cd78b7f96bc6;hp=1b8688e6d398fc1381e6b2acc586ae2562c282f2;hpb=905f8675a728841b03b300d2c7dc909a1c4f7f03;p=github%2Fshaarli%2FShaarli.git
diff --git a/tests/bookmark/LinkUtilsTest.php b/tests/bookmark/LinkUtilsTest.php
index 1b8688e6..c2f9f930 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,196 +89,425 @@ class LinkUtilsTest extends \PHPUnit\Framework\TestCase
}
/**
- * Test the download callback with valid value
+ * Test html_extract_tag() when the tag stuff2