diff --git a/test/classes/navigation/PMA_Node_Table_test.php b/test/classes/navigation/PMA_Node_Table_test.php index 99a0866f46..587644eeda 100644 --- a/test/classes/navigation/PMA_Node_Table_test.php +++ b/test/classes/navigation/PMA_Node_Table_test.php @@ -19,7 +19,7 @@ class Node_Table_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -47,5 +47,37 @@ class Node_Table_Test extends PHPUnit_Framework_TestCase $parent->links['text'] ); } + + /** + * 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 + * + * @return void + * @dataProvider providerForTestIcon + */ + public function testIcon($target, $imageName) + { + $GLOBALS['cfg']['NavigationTreeDefaultTabTable'] = $target; + $node = PMA_NodeFactory::getInstance('Node_Table'); + $this->assertContains($imageName, $node->icon); + } + + /** + * Data provider for testIcon(). + * + * @return array data for testIcon() + */ + public function providerForTestIcon() + { + return array( + array('tbl_structure.php', 'b_props'), + array('tbl_select.php', 'b_search'), + array('tbl_change.php', 'b_insrow'), + array('tbl_sql.php', 'b_sql'), + array('sql.php', 'b_browse'), + ); + } } ?> diff --git a/test/classes/navigation/PMA_Node_View_test.php b/test/classes/navigation/PMA_Node_View_test.php index 293a388a35..b41fac0002 100644 --- a/test/classes/navigation/PMA_Node_View_test.php +++ b/test/classes/navigation/PMA_Node_View_test.php @@ -19,7 +19,7 @@ class Node_View_Test extends PHPUnit_Framework_TestCase { /** * SetUp for test cases - * + * * @return void */ public function setup() @@ -46,6 +46,7 @@ class Node_View_Test extends PHPUnit_Framework_TestCase 'sql.php', $parent->links['text'] ); + $this->assertContains('b_props', $node->icon); } } ?>