Test more doc links generating
Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
a6b7349214
commit
0e233c89ce
@ -62,12 +62,28 @@ class PMA_Sanitize_Test extends PHPUnit_Framework_TestCase
|
||||
* Tests links to documentation.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @dataProvider docLinks
|
||||
*/
|
||||
public function testDoc()
|
||||
public function testDoc($link, $expected)
|
||||
{
|
||||
$this->assertEquals(
|
||||
'<a href="./url.php?url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2Fsetup.html%23foo" target="documentation">doclink</a>',
|
||||
PMA_sanitize('[doc@foo]doclink[/doc]')
|
||||
'<a href="./url.php?url=https%3A%2F%2Fdocs.phpmyadmin.net%2Fen%2Flatest%2F' . $expected . '" target="documentation">doclink</a>',
|
||||
PMA_sanitize('[doc@' . $link . ']doclink[/doc]')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for sanitize [doc@foo] markup
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function docLinks()
|
||||
{
|
||||
return array(
|
||||
array('foo', 'setup.html%23foo'),
|
||||
array('cfg_TitleTable', 'config.html%23cfg_TitleTable'),
|
||||
array('faq3-11', 'faq.html%23faq3-11'),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user