Tests for changing icon based on link target
This commit is contained in:
parent
169aa233e4
commit
7c96afbf1a
@ -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'),
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user