phpmyadmin/tests/unit/Navigation/Nodes/NodeViewTest.php
Maurício Meneghini Fauth 606f66b5df
Rename tests/classes to tests/unit
This directory is for unit tests only, so let's rename it to unit to be
more clear.

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2024-02-23 13:29:07 -03:00

33 lines
956 B
PHP

<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests\Navigation\Nodes;
use PhpMyAdmin\Config;
use PhpMyAdmin\Navigation\Nodes\NodeView;
use PhpMyAdmin\Tests\AbstractTestCase;
use PHPUnit\Framework\Attributes\CoversClass;
#[CoversClass(NodeView::class)]
class NodeViewTest extends AbstractTestCase
{
/**
* Test for __construct
*/
public function testConstructor(): void
{
$parent = new NodeView(new Config(), 'default');
self::assertSame(
[
'text' => ['route' => '/sql', 'params' => ['pos' => 0, 'db' => null, 'table' => null]],
'icon' => ['route' => '/table/structure', 'params' => ['db' => null, 'table' => null]],
],
$parent->links,
);
self::assertSame('b_props', $parent->icon['image']);
self::assertSame('View', $parent->icon['title']);
self::assertStringContainsString('view', $parent->classes);
}
}