Skip to content

Commit

Permalink
Add tests for urls with escaping HTML
Browse files Browse the repository at this point in the history
refs #2
  • Loading branch information
Art4 committed Dec 9, 2016
1 parent 8ad91f6 commit 2492474
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/integration/UrlLinkerEscapingHtmlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,39 @@ public function testUrlsGetLinkedInText($text, $expectedLinked, $message = null)
'Html around: '.$message
);
}

/**
* @dataProvider provideTextsWithHtml
*
* @param string $text
* @param string $expectedLinked
* @param string|null $message
*/
public function testHtmlInText($text, $expectedLinked, $message = null)
{
$this->urlLinker->setAllowUpperCaseUrlSchemes(true);

$this->testUrlsGetLinkedInText($text, $expectedLinked);
}

/**
* provide html in text
*/
public function provideTextsWithHtml()
{
return array(
array(
'http://example.com?a=b&c=d',
$this->link('http://example.com?a=b&c=d', 'example.com'),
),
array(
'http://example.com?a=b&amp%3bc=d',
$this->link('http://example.com?a=b&amp%3bc=d', 'example.com'),
),
array(
'http://example.com?a=b&c=d',
$this->link('http://example.com?a=b&c=d', 'example.com'),
),
);
}
}

0 comments on commit 2492474

Please sign in to comment.