The branch, master has been updated via 3c425a16bcf5aca667f88e95375afefefcdd7d59 (commit) from 56f29962cee8fd240bbc766bd1e64f9865a298bb (commit)
- Log ----------------------------------------------------------------- commit 3c425a16bcf5aca667f88e95375afefefcdd7d59 Author: Michal Čihař mcihar@suse.cz Date: Mon Aug 8 10:38:54 2011 +0200
Add test for PMA_List_Database for functions not requiring DB connection
-----------------------------------------------------------------------
Summary of changes: test/libraries/PMA_List_Database_test.php | 58 +++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) create mode 100644 test/libraries/PMA_List_Database_test.php
diff --git a/test/libraries/PMA_List_Database_test.php b/test/libraries/PMA_List_Database_test.php new file mode 100644 index 0000000..00691e8 --- /dev/null +++ b/test/libraries/PMA_List_Database_test.php @@ -0,0 +1,58 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * tests for PMA_List class + * + * @package phpMyAdmin-test + */ + +/* + * Include to test. + */ +require_once 'libraries/common.lib.php'; +require_once 'libraries/List_Database.class.php'; + +class PMA_List_Database_test extends PHPUnit_Framework_TestCase +{ + public function setup() + { + $GLOBALS['cfg']['Server']['only_db'] = array('single\\_db'); + } + + public function testEmpty() + { + $arr = new PMA_List_Database; + $this->assertEquals('', $arr->getEmpty()); + } + + public function testSingle() + { + $arr = new PMA_List_Database; + $this->assertEquals(true, $arr->getSingleItem()); + } + + public function testExists() + { + $arr = new PMA_List_Database; + $this->assertEquals(true, $arr->exists('single_db')); + } + + public function testLimitedItems() + { + $arr = new PMA_List_Database; + $this->assertEquals(array('single_db'), $arr->getLimitedItems(0, 1)); + } + + public function testLimitedItems_empty() + { + $arr = new PMA_List_Database; + $this->assertEquals(array(), $arr->getLimitedItems(1, 1)); + } + + public function testHtmlOptions() + { + $arr = new PMA_List_Database; + $this->assertEquals('<option value="single_db">single_db</option>' . "\n", $arr->getHtmlOptions()); + } +} +?>
hooks/post-receive