Translation update done using Pootle.
[phpmyadmin/ammaryasirr.git] / test / libraries / common / PMA_getDbLink_test.php
blob00053e1d375c18f70ec62d6525a111731c7b2372
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Test for PMA_getDbLink_test from common.lib.php
6 * @package phpMyAdmin-test
7 * @version $Id: PMA_getDbLink_test.php
8 * @group common.lib-tests
9 */
12 * Include to test.
14 require_once 'libraries/common.lib.php';
16 class PMA_getDbLink_test extends PHPUnit_Framework_TestCase
18 function setUp()
20 global $cfg;
21 require 'libraries/config.default.php';
24 function testGetDbLinkEmpty()
26 $GLOBALS['db'] = null;
27 $this->assertEmpty(PMA_getDbLink());
30 function testGetDbLinkNull()
32 global $cfg;
33 $GLOBALS['db'] = 'test_db';
34 $database = $GLOBALS['db'];
35 $this->assertEquals('<a href="' . $cfg['DefaultTabDatabase'] . '?db=' . $database
36 . '&amp;server=server&amp;lang=en" title="Jump to database &quot;' . htmlspecialchars($database) . '&quot;.">'
37 . htmlspecialchars($database) . '</a>',PMA_getDbLink());
40 function testGetDbLink()
42 global $cfg;
43 $database = 'test_database';
44 $this->assertEquals('<a href="' . $cfg['DefaultTabDatabase'] . '?db=' . $database
45 . '&amp;server=server&amp;lang=en" title="Jump to database &quot;' . htmlspecialchars($database) . '&quot;.">'
46 . htmlspecialchars($database) . '</a>',PMA_getDbLink($database));
49 function testGetDbLinkWithSpecialChars()
51 global $cfg;
52 $database = 'test&data\'base';
53 $this->assertEquals('<a href="' . $cfg['DefaultTabDatabase'] . '?db=' . htmlspecialchars(urlencode($database))
54 . '&amp;server=server&amp;lang=en" title="Jump to database &quot;' . htmlspecialchars($database) . '&quot;.">'
55 . htmlspecialchars($database) . '</a>',PMA_getDbLink($database));