|
6 | 6 |
|
7 | 7 | use PhpMyAdmin\Navigation\NodeFactory; |
8 | 8 | use PhpMyAdmin\Navigation\Nodes\Node; |
| 9 | +use PhpMyAdmin\Navigation\Nodes\NodeDatabase; |
9 | 10 | use PhpMyAdmin\Tests\AbstractTestCase; |
10 | 11 | use PHPUnit\Framework\Attributes\CoversClass; |
11 | 12 |
|
@@ -46,4 +47,24 @@ public function testGroupContainer(): void |
46 | 47 | $this->assertEquals(Node::CONTAINER, $node->type); |
47 | 48 | $this->assertTrue($node->isGroup); |
48 | 49 | } |
| 50 | + |
| 51 | + public function testDatabaseNode(): void |
| 52 | + { |
| 53 | + $node = NodeFactory::getInstance(NodeDatabase::class, 'database_name'); |
| 54 | + $this->assertInstanceOf(NodeDatabase::class, $node); |
| 55 | + $this->assertEquals('database_name', $node->name); |
| 56 | + $this->assertEquals(Node::OBJECT, $node->type); |
| 57 | + $this->assertFalse($node->isGroup); |
| 58 | + } |
| 59 | + |
| 60 | + public function testGetInstanceForNewNode(): void |
| 61 | + { |
| 62 | + $node = NodeFactory::getInstanceForNewNode('New', 'new_database italics'); |
| 63 | + $this->assertEquals('New', $node->name); |
| 64 | + $this->assertEquals(Node::OBJECT, $node->type); |
| 65 | + $this->assertFalse($node->isGroup); |
| 66 | + $this->assertEquals('New', $node->title); |
| 67 | + $this->assertTrue($node->isNew); |
| 68 | + $this->assertEquals('new_database italics', $node->classes); |
| 69 | + } |
49 | 70 | } |
0 commit comments