コード例 #1
0
ファイル: ConfigTest.php プロジェクト: nijel/phpmyadmin
    /**
     * Should test getting unique value for theme
     *
     * @return void
     */
    public function testGetThemeUniqueValue()
    {


        $partial_sum = (
            PHPUnit_Framework_Assert::readAttribute($this->object, 'source_mtime') +
            PHPUnit_Framework_Assert::readAttribute(
                $this->object,
                'default_source_mtime'
            ) +
            $this->object->get('user_preferences_mtime') +
            $_SESSION['PMA_Theme']->mtime_info +
            $_SESSION['PMA_Theme']->filesize_info
        );

        $this->object->set('fontsize', 10);
        $this->assertEquals(10 + $partial_sum, $this->object->getThemeUniqueValue());
        $this->object->set('fontsize', null);

        $_COOKIE['pma_fontsize'] = 20;
        $this->assertEquals(20 + $partial_sum, $this->object->getThemeUniqueValue());
        unset($_COOKIE['pma_fontsize']);

        $this->assertEquals($partial_sum, $this->object->getThemeUniqueValue());

    }
コード例 #2
0
// Selenium tests setup
$test_defaults = array('TESTSUITE_SERVER' => 'localhost', 'TESTSUITE_USER' => 'root', 'TESTSUITE_PASSWORD' => '', 'TESTSUITE_DATABASE' => 'test', 'TESTSUITE_URL' => 'http://localhost/phpmyadmin/', 'TESTSUITE_SELENIUM_HOST' => '', 'TESTSUITE_SELENIUM_PORT' => '4444', 'TESTSUITE_SELENIUM_BROWSER' => 'firefox', 'TESTSUITE_SELENIUM_COVERAGE' => '', 'TESTSUITE_BROWSERSTACK_USER' => '', 'TESTSUITE_BROWSERSTACK_KEY' => '', 'TESTSUITE_FULL' => '');
foreach ($test_defaults as $varname => $defvalue) {
    $envvar = getenv($varname);
    if ($envvar) {
        $GLOBALS[$varname] = $envvar;
    } else {
        $GLOBALS[$varname] = $defvalue;
    }
}
require_once 'libraries/autoloader.php';
require_once 'libraries/core.lib.php';
$GLOBALS['PMA_String'] = new PMA_String();
$CFG = new PMA\libraries\Config();
// Initialize PMA_VERSION variable
define('PMA_VERSION', $CFG->get('PMA_VERSION'));
unset($CFG);
require_once 'libraries/sql-parser/autoload.php';
// Set proxy information from env, if available
$http_proxy = getenv('http_proxy');
if ($http_proxy && ($url_info = parse_url($http_proxy))) {
    define('PROXY_URL', $url_info['host'] . ':' . $url_info['port']);
    define('PROXY_USER', empty($url_info['user']) ? '' : $url_info['user']);
    define('PROXY_PASS', empty($url_info['pass']) ? '' : $url_info['pass']);
} else {
    define('PROXY_URL', '');
    define('PROXY_USER', '');
    define('PROXY_PASS', '');
}
// Ensure we have session started
session_start();