3.1.3 release
[phpmyadmin/crack.git] / test / PMA_sanitize_test.php
blob25168c8f4f5ede48c2cea07ad017a184120a27f5
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 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]'));