2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * tests for PMA_List_Database class
6 * @package phpMyAdmin-test
12 require_once 'libraries/common.lib.php';
13 require_once 'libraries/List_Database.class.php';
15 class PMA_List_Database_test
extends PHPUnit_Framework_TestCase
17 public function setup()
19 $GLOBALS['cfg']['Server']['only_db'] = array('single\\_db');
22 public function testEmpty()
24 $arr = new PMA_List_Database
;
25 $this->assertEquals('', $arr->getEmpty());
28 public function testSingle()
30 $arr = new PMA_List_Database
;
31 $this->assertEquals(true, $arr->getSingleItem());
34 public function testExists()
36 $arr = new PMA_List_Database
;
37 $this->assertEquals(true, $arr->exists('single_db'));
40 public function testLimitedItems()
42 $arr = new PMA_List_Database
;
43 $this->assertEquals(array('single_db'), $arr->getLimitedItems(0, 1));
46 public function testLimitedItems_empty()
48 $arr = new PMA_List_Database
;
49 $this->assertEquals(array(), $arr->getLimitedItems(1, 1));
52 public function testHtmlOptions()
54 $arr = new PMA_List_Database
;
55 $this->assertEquals('<option value="single_db">single_db</option>' . "\n", $arr->getHtmlOptions());