Fix typo (pre -> per).
[phpmyadmin/crack.git] / test / PMA_sanitize_test.php
blob091f7b095e1a57eaa04ab66f0e44af21221ea5f7
1 <?php
2 /* vim: 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 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('&lt;div onclick=""&gt;',
33 PMA_sanitize('<div onclick="">'));
36 public function testBbcoe()
38 $this->assertEquals('<strong>strong</strong>',
39 PMA_sanitize('[b]strong[/b]'));