bug#3212720 Show error message on error.
[phpmyadmin/ayax.git] / test / PMA_escapeMySqlWildcards_test.php
blobccdf15b972f76c6fd66570b850015c80a534d579
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Test for MySQL Wildcards escaping/unescaping
6 * @package phpMyAdmin-test
7 */
9 /**
10 * Tests core.
12 require_once 'PHPUnit/Framework.php';
14 /**
15 * Include to test.
17 require_once './libraries/common.lib.php';
19 /**
20 * Test MySQL escaping.
23 class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase
26 public function escapeDataProvider() {
27 return array(
28 array('\_test', '_test'),
29 array('\_\\', '_\\'),
30 array('\\_\%', '_%'),
31 array('\\\_', '\_'),
32 array('\\\_\\\%', '\_\%'),
33 array('\_\\%\_\_\%', '_%__%'),
34 array('\%\_', '%_'),
35 array('\\\%\\\_', '\%\_')
39 /**
40 * PMA_escape_mysql_wildcards tests
41 * @dataProvider escapeDataProvider
44 public function testEscape($a, $b)
46 $this->assertEquals($a, PMA_escape_mysql_wildcards($b));
49 /**
50 * PMA_unescape_mysql_wildcards tests
51 * @dataProvider escapeDataProvider
54 public function testUnEscape($a, $b)
56 $this->assertEquals($b, PMA_unescape_mysql_wildcards($a));