3 declare(strict_types
=1);
5 namespace PhpMyAdmin\Tests\Navigation
;
7 use PhpMyAdmin\Navigation\NavigationTree
;
8 use PhpMyAdmin\Template
;
9 use PhpMyAdmin\Tests\AbstractTestCase
;
12 * @covers \PhpMyAdmin\Navigation\NavigationTree
14 class NavigationTreeTest
extends AbstractTestCase
16 /** @var NavigationTree */
20 * Sets up the fixture.
22 protected function setUp(): void
25 parent
::setLanguage();
26 parent
::setGlobalConfig();
28 $GLOBALS['server'] = 1;
29 $GLOBALS['cfg']['Server']['host'] = 'localhost';
30 $GLOBALS['cfg']['Server']['user'] = 'user';
31 $GLOBALS['cfg']['Server']['pmadb'] = '';
32 $GLOBALS['cfg']['Server']['DisableIS'] = false;
33 $GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
34 $GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] = true;
36 $GLOBALS['db'] = 'db';
37 $GLOBALS['table'] = '';
38 $GLOBALS['PMA_PHP_SELF'] = '';
40 $this->object = new NavigationTree(new Template(), $GLOBALS['dbi']);
44 * Tears down the fixture.
46 protected function tearDown(): void
53 * Very basic rendering test.
55 public function testRenderState(): void
57 $result = $this->object->renderState();
58 $this->assertStringContainsString('pma_quick_warp', $result);
62 * Very basic path rendering test.
64 public function testRenderPath(): void
66 $result = $this->object->renderPath();
67 $this->assertIsString($result);
68 $this->assertStringContainsString('list_container', $result);
72 * Very basic select rendering test.
74 public function testRenderDbSelect(): void
76 $result = $this->object->renderDbSelect();
77 $this->assertStringContainsString('pma_navigation_select_database', $result);