The branch, master has been updated via d4c9e4135e6497d24e9b3d1070f649ae196f8ead (commit) via 85eb9c74a11279c31ec1a6b54b67f05679d8c119 (commit) from 22b46564e106dbc8aede393466b21eecc321883d (commit)
- Log ----------------------------------------------------------------- commit d4c9e4135e6497d24e9b3d1070f649ae196f8ead Author: Michal Čihař mcihar@suse.cz Date: Thu Aug 4 17:32:18 2011 +0200
Fix comments
commit 85eb9c74a11279c31ec1a6b54b67f05679d8c119 Author: Michal Čihař mcihar@suse.cz Date: Thu Aug 4 17:31:55 2011 +0200
Add testcase for PMA_expandUserString
-----------------------------------------------------------------------
Summary of changes: .../libraries/common/PMA_expandUserString_test.php | 74 ++++++++++++++++++++ .../libraries/common/PMA_extractFieldSpec_test.php | 3 +- 2 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 test/libraries/common/PMA_expandUserString_test.php
diff --git a/test/libraries/common/PMA_expandUserString_test.php b/test/libraries/common/PMA_expandUserString_test.php new file mode 100644 index 0000000..4b3e176 --- /dev/null +++ b/test/libraries/common/PMA_expandUserString_test.php @@ -0,0 +1,74 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Test for PMA_expandUserString from common.lib.php + * + * @package phpMyAdmin-test + * @group common.lib-tests + */ + +/* + * Include to test. + */ +require_once 'libraries/core.lib.php'; +require_once 'libraries/common.lib.php'; + +if (!defined('PMA_VERSION')) { + define('PMA_VERSION', 'TEST'); +} + +/** + * Test for PMA_expandUserString function. + */ +class PMA_expandUserString_test extends PHPUnit_Extensions_OutputTestCase +{ + + /** + * Setup variables needed by test. + */ + public function setup() + { + $GLOBALS['cfg'] = array( + 'Server' => array( + 'host' => 'host&', + 'verbose' => 'verbose', + )); + $GLOBALS['db'] = 'database'; + $GLOBALS['table'] = 'table'; + } + + /** + * Test case for parsing SHOW COLUNS output + * + * @dataProvider provider + */ + public function testExpand($in, $out) + { + $this->assertEquals($out, PMA_expandUserString($in)); + } + + /** + * Test case for parsing SHOW COLUNS output + * + * @dataProvider provider + */ + public function testExpandEscape($in, $out) + { + $this->assertEquals(htmlspecialchars($out), PMA_expandUserString($in, 'htmlspecialchars')); + } + + /** + * Data provider + */ + public function provider() + { + return array( + array('@SERVER@', 'host&'), + array('@VSERVER@', 'verbose'), + array('@DATABASE@', 'database'), + array('@TABLE@', 'table'), + array('@IGNORE@', '@IGNORE@'), + array('@PHPMYADMIN@', 'phpMyAdmin ' . PMA_VERSION), + ); + } +} diff --git a/test/libraries/common/PMA_extractFieldSpec_test.php b/test/libraries/common/PMA_extractFieldSpec_test.php index ecb9bd0..d87fdbc 100644 --- a/test/libraries/common/PMA_extractFieldSpec_test.php +++ b/test/libraries/common/PMA_extractFieldSpec_test.php @@ -2,10 +2,9 @@ <?php /* vim: set expandtab sw=4 ts=4 sts=4: */ /** - * Test for PMA_checkParameters from common.lib.php + * Test for PMA_extractFieldSpec from common.lib.php * * @package phpMyAdmin-test - * @version $Id: PMA_checkParameters_test.php * @group common.lib-tests */
hooks/post-receive