new tests, thanks to Michal Biniek
This commit is contained in:
@@ -34,8 +34,8 @@ require_once './test/PMA_isValid_test.php';
|
||||
require_once './test/PMA_transformation_getOptions_test.php';
|
||||
require_once './test/PMA_STR_sub_test.php';
|
||||
require_once './test/PMA_generateCommonUrl_test.php';
|
||||
//require_once './test/PMA_arrayWalkRecursive_test.php';
|
||||
require_once './test/PMA_blowfish_test.php';
|
||||
require_once './test/PMA_escapeMySqlWildcards_test.php';
|
||||
|
||||
class AllTests
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* tests for PMA_pow()
|
||||
*
|
||||
* @version $Id: PMA_pow_test.php 10140 2007-03-20 08:32:55Z cybot_tm $
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
* Test for blowfish encryption.
|
||||
*
|
||||
* @package phpMyAdmin-test
|
||||
* @version $Id: PMA_escapeJsString_test.php 10237 2007-04-01 08:23:23Z cybot_tm $
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
|
86
test/PMA_escapeMySqlWildcards_test.php
Normal file
86
test/PMA_escapeMySqlWildcards_test.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for MySQL Wildcards escaping/unescaping
|
||||
*
|
||||
* @author Michal Biniek <michal@bystrzyca.pl>
|
||||
* @package phpMyAdmin-test
|
||||
* @version $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tests core.
|
||||
*/
|
||||
require_once 'PHPUnit/Framework.php';
|
||||
|
||||
/**
|
||||
* Include to test.
|
||||
*/
|
||||
require_once './libraries/common.lib.php';
|
||||
|
||||
/**
|
||||
* Test MySQL escaping.
|
||||
*
|
||||
*/
|
||||
class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
* PMA_escape_mysql_wildcards tests
|
||||
*/
|
||||
|
||||
public function testEscape_1()
|
||||
{
|
||||
$this->assertEquals('\_test', PMA_escape_mysql_wildcards('_test'));
|
||||
}
|
||||
|
||||
public function testEscape_2()
|
||||
{
|
||||
$this->assertEquals('\_\\', PMA_escape_mysql_wildcards('_\\'));
|
||||
}
|
||||
|
||||
public function testEscape_3()
|
||||
{
|
||||
$this->assertEquals('\\_\%', PMA_escape_mysql_wildcards('_%'));
|
||||
}
|
||||
|
||||
public function testEscape_4()
|
||||
{
|
||||
$this->assertEquals('\\\_', PMA_escape_mysql_wildcards('\_'));
|
||||
}
|
||||
|
||||
public function testEscape_5()
|
||||
{
|
||||
$this->assertEquals('\\\_\\\%', PMA_escape_mysql_wildcards('\_\%'));
|
||||
}
|
||||
|
||||
/**
|
||||
* PMA_unescape_mysql_wildcards tests
|
||||
*/
|
||||
|
||||
public function testUnEscape_1()
|
||||
{
|
||||
$this->assertEquals('_test', PMA_unescape_mysql_wildcards('\_test'));
|
||||
}
|
||||
|
||||
public function testUnEscape_2()
|
||||
{
|
||||
$this->assertEquals('_%__%', PMA_unescape_mysql_wildcards('\_\\%\_\_\%'));
|
||||
}
|
||||
|
||||
public function testUnEscape_3()
|
||||
{
|
||||
$this->assertEquals('\_', PMA_unescape_mysql_wildcards('\\\_'));
|
||||
}
|
||||
|
||||
public function testUnEscape_4()
|
||||
{
|
||||
$this->assertEquals('%_', PMA_unescape_mysql_wildcards('%\_'));
|
||||
}
|
||||
|
||||
public function testUnEscape_5()
|
||||
{
|
||||
$this->assertEquals('\%\_', PMA_unescape_mysql_wildcards('\\\%\\\_'));
|
||||
}
|
||||
}
|
||||
?>
|
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* tests for PMA_generate_common_url()
|
||||
*
|
||||
* @version $Id: PMA_get_real_size_test.php 10146 2007-03-20 14:16:18Z cybot_tm $
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* tests for PMA_pow()
|
||||
*
|
||||
* @version $Id: PMA_pow_test.php 10140 2007-03-20 08:32:55Z cybot_tm $
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
/**
|
||||
* tests for PMA_sanitize()
|
||||
*
|
||||
* @version $Id: PMA_sanitize_test.php 10140 2007-03-20 08:32:55Z cybot_tm $
|
||||
* @version $Id$
|
||||
* @package phpMyAdmin-test
|
||||
*/
|
||||
|
||||
|
Reference in New Issue
Block a user