2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test for MySQL Wildcards escaping/unescaping
6 * @package phpMyAdmin-test
13 require_once 'PHPUnit/Framework.php';
18 require_once './libraries/common.lib.php';
21 * Test MySQL escaping.
24 class PMA_escapeMySqlWildcards_test
extends PHPUnit_Framework_TestCase
27 public function escapeDataProvider() {
29 array('\_test', '_test'),
33 array('\\\_\\\%', '\_\%'),
34 array('\_\\%\_\_\%', '_%__%'),
36 array('\\\%\\\_', '\%\_')
41 * PMA_escape_mysql_wildcards tests
42 * @dataProvider escapeDataProvider
45 public function testEscape($a, $b)
47 $this->assertEquals($a, PMA_escape_mysql_wildcards($b));
51 * PMA_unescape_mysql_wildcards tests
52 * @dataProvider escapeDataProvider
55 public function testUnEscape($a, $b)
57 $this->assertEquals($b, PMA_unescape_mysql_wildcards($a));