[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-13360-g44f007a

Michal Čihař nijel at users.sourceforge.net
Mon Aug 8 11:54:45 CEST 2011


The branch, master has been updated
       via  44f007a87912cb1a1078ce0ec6820d67b43138bf (commit)
      from  3c425a16bcf5aca667f88e95375afefefcdd7d59 (commit)


- Log -----------------------------------------------------------------
commit 44f007a87912cb1a1078ce0ec6820d67b43138bf
Author: Michal Čihař <mcihar at suse.cz>
Date:   Mon Aug 8 11:54:23 2011 +0200

    Add tests for theme manager

-----------------------------------------------------------------------

Summary of changes:
 test/libraries/PMA_Theme_Manager_test.php |   51 +++++++++++++++++++++++++++++
 1 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 test/libraries/PMA_Theme_Manager_test.php

diff --git a/test/libraries/PMA_Theme_Manager_test.php b/test/libraries/PMA_Theme_Manager_test.php
new file mode 100644
index 0000000..361417b
--- /dev/null
+++ b/test/libraries/PMA_Theme_Manager_test.php
@@ -0,0 +1,51 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * tests for PMA_Theme_Manager class
+ *
+ * @package phpMyAdmin-test
+ */
+
+/*
+ * Include to test.
+ */
+require_once 'libraries/common.lib.php';
+require_once 'libraries/url_generating.lib.php';
+require_once 'libraries/php-gettext/gettext.inc';
+require_once 'libraries/Theme.class.php';
+require_once 'libraries/Theme_Manager.class.php';
+
+class PMA_Theme_Manager_test extends PHPUnit_Framework_TestCase
+{
+    public function setup()
+    {
+        $GLOBALS['cfg']['ThemePath'] = './themes';
+        $GLOBALS['cfg']['ThemePerServer'] = false;
+        $GLOBALS['cfg']['ThemeDefault'] = 'pmahomme';
+        $GLOBALS['cfg']['ServerDefault'] = 0;
+        $GLOBALS['server'] = 99;
+        $_SESSION[' PMA_token '] = 'token';
+    }
+
+    public function testCookieName()
+    {
+        $tm = new PMA_Theme_Manager();
+        $this->assertEquals('pma_theme', $tm->getThemeCookieName());
+    }
+
+    public function testPerServerCookieName()
+    {
+        $tm = new PMA_Theme_Manager();
+        $tm->setThemePerServer(true);
+        $this->assertEquals('pma_theme-99', $tm->getThemeCookieName());
+    }
+
+    public function testHtmlSelectBox()
+    {
+        $tm = new PMA_Theme_Manager();
+        $this->assertContains('<option value="pmahomme" selected="selected">', $tm->getHtmlSelectBox());
+    }
+
+}
+?>
+


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list