Translation update done using Pootle.
[phpmyadmin/ammaryasirr.git] / test / libraries / common / PMA_escapeMySqlWildcards_test.php
blobc77a841fe730a4319a994204be84a166c62e79d8
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 * @version $Id: PMA_escapeMySqlWildcards_test.php
8 * @group common.lib-tests
9 */
12 * Include to test.
14 require_once 'libraries/common.lib.php';
16 class PMA_escapeMySqlWildcards_test extends PHPUnit_Framework_TestCase
19 public function escapeDataProvider() {
20 return array(
21 array('\_test', '_test'),
22 array('\_\\', '_\\'),
23 array('\\_\%', '_%'),
24 array('\\\_', '\_'),
25 array('\\\_\\\%', '\_\%'),
26 array('\_\\%\_\_\%', '_%__%'),
27 array('\%\_', '%_'),
28 array('\\\%\\\_', '\%\_')
32 /**
33 * PMA_escape_mysql_wildcards tests
34 * @dataProvider escapeDataProvider
37 public function testEscape($a, $b)
39 $this->assertEquals($a, PMA_escape_mysql_wildcards($b));
42 /**
43 * PMA_unescape_mysql_wildcards tests
44 * @dataProvider escapeDataProvider
47 public function testUnEscape($a, $b)
49 $this->assertEquals($b, PMA_unescape_mysql_wildcards($a));