Translation update done using Pootle.
[phpmyadmin/crack.git] / test / PMA_sanitize_test.php
blob1400c7edee3d29531d864340e28dd88e623fae31
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * tests for PMA_sanitize()
6 * @package phpMyAdmin-test
7 */
9 /**
12 require_once 'PHPUnit/Framework.php';
13 require_once './libraries/sanitizing.lib.php';
15 /**
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('&lt;div onclick=""&gt;',
35 PMA_sanitize('<div onclick="">'));
38 public function testBbcoe()
40 $this->assertEquals('<strong>strong</strong>',
41 PMA_sanitize('[b]strong[/b]'));