2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * tests for PMA_sanitize()
6 * @package phpMyAdmin-test
12 require_once 'PHPUnit/Framework.php';
13 require_once './libraries/sanitizing.lib.php';
16 * @package phpMyAdmin-test
18 class PMA_sanitize_test
extends PHPUnit_Framework_TestCase
20 public function testXssInHref()
22 $this->assertEquals('[a@javascript:alert(\'XSS\');@target]link</a>',
23 PMA_sanitize('[a@javascript:alert(\'XSS\');@target]link[/a]'));
26 public function testLink()
28 $this->assertEquals('<a href="http://www.phpmyadmin.net/" target="target">link</a>',
29 PMA_sanitize('[a@http://www.phpmyadmin.net/@target]link[/a]'));
32 public function testHtmlTags()
34 $this->assertEquals('<div onclick="">',
35 PMA_sanitize('<div onclick="">'));
38 public function testBbcoe()
40 $this->assertEquals('<strong>strong</strong>',
41 PMA_sanitize('[b]strong[/b]'));