assertIsArray($parent->links); $this->assertEquals( [ 'text' => ['route' => '/sql', 'params' => ['pos' => 0, 'db' => null, 'table' => null]], 'icon' => ['route' => '/table/search', 'params' => ['db' => null, 'table' => null]], 'second_icon' => ['route' => '/table/change', 'params' => ['db' => null, 'table' => null]], 'title' => 'Browse', ], $parent->links ); $this->assertStringContainsString('table', $parent->classes); } /** * Tests whether the node icon is properly set based on the icon target. * * @param string $target target of the icon * @param string $imageName name of the image that should be set * * @dataProvider providerForTestIcon */ public function testIcon(string $target, string $imageName, string $imageTitle): void { $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = $target; $node = NodeFactory::getInstance('NodeTable'); $this->assertEquals($imageName, $node->icon['image']); $this->assertEquals($imageTitle, $node->icon['title']); } /** * Data provider for testIcon(). * * @return array data for testIcon() */ public function providerForTestIcon(): array { return [ ['structure', 'b_props', 'Structure'], ['search', 'b_search', 'Search'], ['insert', 'b_insrow', 'Insert'], ['sql', 'b_sql', 'SQL'], ['browse', 'b_browse', 'Browse'], ]; } }