diff --git a/test/classes/Navigation/NodeFactoryTest.php b/test/classes/Navigation/NodeFactoryTest.php index 12cdd2834c..3140020496 100644 --- a/test/classes/Navigation/NodeFactoryTest.php +++ b/test/classes/Navigation/NodeFactoryTest.php @@ -6,6 +6,7 @@ namespace PhpMyAdmin\Tests\Navigation; use PhpMyAdmin\Navigation\NodeFactory; use PhpMyAdmin\Navigation\Nodes\Node; +use PhpMyAdmin\Navigation\Nodes\NodeDatabase; use PhpMyAdmin\Tests\AbstractTestCase; use PHPUnit\Framework\Attributes\CoversClass; @@ -46,4 +47,24 @@ class NodeFactoryTest extends AbstractTestCase $this->assertEquals(Node::CONTAINER, $node->type); $this->assertTrue($node->isGroup); } + + public function testDatabaseNode(): void + { + $node = NodeFactory::getInstance(NodeDatabase::class, 'database_name'); + $this->assertInstanceOf(NodeDatabase::class, $node); + $this->assertEquals('database_name', $node->name); + $this->assertEquals(Node::OBJECT, $node->type); + $this->assertFalse($node->isGroup); + } + + public function testGetInstanceForNewNode(): void + { + $node = NodeFactory::getInstanceForNewNode('New', 'new_database italics'); + $this->assertEquals('New', $node->name); + $this->assertEquals(Node::OBJECT, $node->type); + $this->assertFalse($node->isGroup); + $this->assertEquals('New', $node->title); + $this->assertTrue($node->isNew); + $this->assertEquals('new_database italics', $node->classes); + } }