patch #2494192 [display] Possibility of disabling the sliders
[phpmyadmin/crack.git] / test / PMA_sanitize_test.php
blob396daa6046213a8688a522d29d7a419cb4953d20
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * tests for PMA_sanitize()
6 * @version $Id$
7 * @package phpMyAdmin-test
8 */
10 /**
13 require_once 'PHPUnit/Framework.php';
14 require_once './libraries/sanitizing.lib.php';
16 /**
17 * @package phpMyAdmin-test
19 class PMA_sanitize_test extends PHPUnit_Framework_TestCase
21 public function testXssInHref()
23 $this->assertEquals('[a@javascript:alert(\'XSS\');@target]link</a>',
24 PMA_sanitize('[a@javascript:alert(\'XSS\');@target]link[/a]'));
27 public function testLink()
29 $this->assertEquals('<a href="http://www.phpmyadmin.net/" target="target">link</a>',
30 PMA_sanitize('[a@http://www.phpmyadmin.net/@target]link[/a]'));
33 public function testHtmlTags()
35 $this->assertEquals('&lt;div onclick=""&gt;',
36 PMA_sanitize('<div onclick="">'));
39 public function testBbcoe()
41 $this->assertEquals('<strong>strong</strong>',
42 PMA_sanitize('[b]strong[/b]'));