Unused messages
[phpmyadmin.git] / test / libraries / common / PMA_checkParameters_test.php
blob7e1bd4f835d2abad6c1c0b9fe57baf823e960a1b
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Test for PMA_checkParameters from common.lib.php
6 * @package PhpMyAdmin-test
7 * @version $Id: PMA_checkParameters_test.php
8 * @group common.lib-tests
9 */
12 * Include to test.
14 require_once 'libraries/common.lib.php';
15 require_once 'libraries/Theme.class.php';
17 class PMA_checkParameters_test extends PHPUnit_Extensions_OutputTestCase
19 function setup()
21 $GLOBALS['PMA_Config'] = new PMA_Config();
22 $_SESSION['PMA_Theme'] = new PMA_Theme();
23 $GLOBALS['cfg'] = array('ReplaceHelpImg' => true, 'ServerDefault' => 1);
24 $GLOBALS['pmaThemeImage'] = 'theme/';
27 function testCheckParameterMissing()
29 $GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
30 $GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath();
32 $this->expectOutputRegex("/Missing parameter: field/" );
34 PMA_checkParameters(array('db', 'table', 'field'), false);
37 function testCheckParameter()
39 $GLOBALS['PMA_PHP_SELF'] = PMA_getenv('PHP_SELF');
40 $GLOBALS['pmaThemePath'] = $_SESSION['PMA_Theme']->getPath();
41 $GLOBALS['db'] = "dbDatabase";
42 $GLOBALS['table'] = "tblTable";
43 $GLOBALS['field'] = "test_field";
44 $GLOBALS['sql_query'] = "SELECT * FROM tblTable;";
46 $this->expectOutputString("");
47 PMA_checkParameters(array('db', 'table', 'field', 'sql_query'), false);