phpmyadmin/test/classes/Navigation/Nodes/NodeTableContainerTest.php
Maurício Meneghini Fauth 67e96cf40c
Get default config values from Config\Settings classes
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2021-09-30 12:04:47 -03:00

46 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests\Navigation\Nodes;
use PhpMyAdmin\Navigation\NodeFactory;
use PhpMyAdmin\Tests\AbstractTestCase;
/**
* @covers \PhpMyAdmin\Navigation\Nodes\NodeTableContainer
*/
class NodeTableContainerTest extends AbstractTestCase
{
/**
* SetUp for test cases
*/
protected function setUp(): void
{
parent::setUp();
$GLOBALS['server'] = 0;
$GLOBALS['cfg']['NavigationTreeEnableGrouping'] = true;
$GLOBALS['cfg']['NavigationTreeDbSeparator'] = '_';
$GLOBALS['cfg']['NavigationTreeTableSeparator'] = '__';
$GLOBALS['cfg']['NavigationTreeTableLevel'] = 1;
}
/**
* Test for __construct
*/
public function testConstructor(): void
{
$parent = NodeFactory::getInstance('NodeTableContainer');
$this->assertIsArray($parent->links);
$this->assertEquals(
[
'text' => ['route' => '/database/structure', 'params' => ['tbl_type' => 'table', 'db' => null]],
'icon' => ['route' => '/database/structure', 'params' => ['tbl_type' => 'table', 'db' => null]],
],
$parent->links
);
$this->assertEquals('tables', $parent->realName);
$this->assertStringContainsString('tableContainer', $parent->classes);
}
}