Remove `@access` annotations
[phpmyadmin.git] / test / classes / Navigation / NavigationTreeTest.php
blob615e446773e37dd37105f7250c3b8820557934ce
1 <?php
3 declare(strict_types=1);
5 namespace PhpMyAdmin\Tests\Navigation;
7 use PhpMyAdmin\Navigation\NavigationTree;
8 use PhpMyAdmin\Template;
9 use PhpMyAdmin\Tests\AbstractTestCase;
11 /**
12 * @covers \PhpMyAdmin\Navigation\NavigationTree
14 class NavigationTreeTest extends AbstractTestCase
16 /** @var NavigationTree */
17 protected $object;
19 /**
20 * Sets up the fixture.
22 protected function setUp(): void
24 parent::setUp();
25 parent::setLanguage();
26 parent::setGlobalConfig();
27 parent::setTheme();
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']);
43 /**
44 * Tears down the fixture.
46 protected function tearDown(): void
48 parent::tearDown();
49 unset($this->object);
52 /**
53 * Very basic rendering test.
55 public function testRenderState(): void
57 $result = $this->object->renderState();
58 $this->assertStringContainsString('pma_quick_warp', $result);
61 /**
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);
71 /**
72 * Very basic select rendering test.
74 public function testRenderDbSelect(): void
76 $result = $this->object->renderDbSelect();
77 $this->assertStringContainsString('pma_navigation_select_database', $result);