2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test for MySQL Wildcards escaping/unescaping
6 * @package phpMyAdmin-test
12 require_once 'PHPUnit/Framework.php';
17 require_once './libraries/common.lib.php';
20 * Test MySQL escaping.
23 class PMA_escapeMySqlWildcards_test
extends PHPUnit_Framework_TestCase
26 public function escapeDataProvider() {
28 array('\_test', '_test'),
32 array('\\\_\\\%', '\_\%'),
33 array('\_\\%\_\_\%', '_%__%'),
35 array('\\\%\\\_', '\%\_')
40 * PMA_escape_mysql_wildcards tests
41 * @dataProvider escapeDataProvider
44 public function testEscape($a, $b)
46 $this->assertEquals($a, PMA_escape_mysql_wildcards($b));
50 * PMA_unescape_mysql_wildcards tests
51 * @dataProvider escapeDataProvider
54 public function testUnEscape($a, $b)
56 $this->assertEquals($b, PMA_unescape_mysql_wildcards($a));