2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Test for MySQL Wildcards escaping/unescaping
6 * @package phpMyAdmin-test
7 * @version $Id: PMA_escapeMySqlWildcards_test.php
8 * @group common.lib-tests
14 require_once 'libraries/common.lib.php';
16 class PMA_escapeMySqlWildcards_test
extends PHPUnit_Framework_TestCase
19 public function escapeDataProvider() {
21 array('\_test', '_test'),
25 array('\\\_\\\%', '\_\%'),
26 array('\_\\%\_\_\%', '_%__%'),
28 array('\\\%\\\_', '\%\_')
33 * PMA_escape_mysql_wildcards tests
34 * @dataProvider escapeDataProvider
37 public function testEscape($a, $b)
39 $this->assertEquals($a, PMA_escape_mysql_wildcards($b));
43 * PMA_unescape_mysql_wildcards tests
44 * @dataProvider escapeDataProvider
47 public function testUnEscape($a, $b)
49 $this->assertEquals($b, PMA_unescape_mysql_wildcards($a));