2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * tests for PMA_Theme_Manager class
6 * @package phpMyAdmin-test
12 require_once 'libraries/common.lib.php';
13 require_once 'libraries/url_generating.lib.php';
14 require_once 'libraries/php-gettext/gettext.inc';
15 require_once 'libraries/Theme.class.php';
16 require_once 'libraries/Theme_Manager.class.php';
18 class PMA_Theme_Manager_test
extends PHPUnit_Framework_TestCase
20 public function setup()
22 $GLOBALS['cfg']['ThemePath'] = './themes';
23 $GLOBALS['cfg']['ThemePerServer'] = false;
24 $GLOBALS['cfg']['ThemeDefault'] = 'pmahomme';
25 $GLOBALS['cfg']['ServerDefault'] = 0;
26 $GLOBALS['server'] = 99;
27 $_SESSION[' PMA_token '] = 'token';
30 public function testCookieName()
32 $tm = new PMA_Theme_Manager();
33 $this->assertEquals('pma_theme', $tm->getThemeCookieName());
36 public function testPerServerCookieName()
38 $tm = new PMA_Theme_Manager();
39 $tm->setThemePerServer(true);
40 $this->assertEquals('pma_theme-99', $tm->getThemeCookieName());
43 public function testHtmlSelectBox()
45 $tm = new PMA_Theme_Manager();
46 $this->assertContains('<option value="pmahomme" selected="selected">', $tm->getHtmlSelectBox());