2 /* vim: expandtab sw=4 ts=4 sts=4: */
4 * tests for PMA_sanitize()
7 * @package phpMyAdmin-test
13 require_once 'PHPUnit/Framework.php';
14 require_once './libraries/sanitizing.lib.php';
16 class PMA_sanitize_test
extends PHPUnit_Framework_TestCase
18 public function testXssInHref()
20 $this->assertEquals('[a@javascript:alert(\'XSS\');@target]link</a>',
21 PMA_sanitize('[a@javascript:alert(\'XSS\');@target]link[/a]'));
24 public function testLink()
26 $this->assertEquals('<a href="http://www.phpmyadmin.net/" target="target">link</a>',
27 PMA_sanitize('[a@http://www.phpmyadmin.net/@target]link[/a]'));
30 public function testHtmlTags()
32 $this->assertEquals('<div onclick="">',
33 PMA_sanitize('<div onclick="">'));
36 public function testBbcoe()
38 $this->assertEquals('<strong>strong</strong>',
39 PMA_sanitize('[b]strong[/b]'));