cebe\markdown\tests\GithubMarkdownTest::testAutoLinkLabelingWithEncodedUrl PHP Method

testAutoLinkLabelingWithEncodedUrl() public method

    public function testAutoLinkLabelingWithEncodedUrl()
    {
        $parser = $this->createMarkdown();
        $utfText = "あいうえお";
        $utfNaturalUrl = "http://example.com/" . $utfText;
        $utfEncodedUrl = "http://example.com/" . urlencode($utfText);
        $eucEncodedUrl = "http://example.com/" . urlencode(mb_convert_encoding($utfText, 'EUC-JP', 'UTF-8'));
        $this->assertStringEndsWith(">{$utfNaturalUrl}</a>", $parser->parseParagraph($utfNaturalUrl), "Natural UTF-8 URL needs no conversion.");
        $this->assertStringEndsWith(">{$utfNaturalUrl}</a>", $parser->parseParagraph($utfEncodedUrl), "Encoded UTF-8 URL will be converted to readable format.");
        $this->assertStringEndsWith(">{$eucEncodedUrl}</a>", $parser->parseParagraph($eucEncodedUrl), "Non UTF-8 URL should never be converted.");
        // See: \cebe\markdown\inline\UrlLinkTrait::renderAutoUrl
    }