2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test for MySQL Wildcards escaping/unescaping
6 * @author Michal Biniek <michal@bystrzyca.pl>
7 * @package phpMyAdmin-test
14 require_once 'PHPUnit/Framework.php';
19 require_once './libraries/common.lib.php';
22 * Test MySQL escaping.
25 class PMA_escapeMySqlWildcards_test
extends PHPUnit_Framework_TestCase
28 public function escapeDataProvider() {
30 array('\_test', '_test'),
34 array('\\\_\\\%', '\_\%'),
35 array('\_\\%\_\_\%', '_%__%'),
37 array('\\\%\\\_', '\%\_')
42 * PMA_escape_mysql_wildcards tests
43 * @dataProvider escapeDataProvider
46 public function testEscape($a, $b)
48 $this->assertEquals($a, PMA_escape_mysql_wildcards($b));
52 * PMA_unescape_mysql_wildcards tests
53 * @dataProvider escapeDataProvider
56 public function testUnEscape($a, $b)
58 $this->assertEquals($b, PMA_unescape_mysql_wildcards($a));