Merge pull request #337 from adamgsoc2013/unit_container1
add test for container
This commit is contained in:
commit
b784e8e614
37
test/classes/navigation/PMA_Node_Column_Container _test.php
Normal file
37
test/classes/navigation/PMA_Node_Column_Container _test.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for NodeFactory class and Node_Column_Container class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.class.php';
|
||||
require_once 'libraries/Util.class.php';
|
||||
require_once 'libraries/Theme.class.php';
|
||||
|
||||
|
||||
class Node_Column_Container_Test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setup()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['token'] = 'token';
|
||||
$_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
|
||||
}
|
||||
|
||||
public function testConstructor()
|
||||
{
|
||||
$parent = PMA_NodeFactory::getInstance('Node_Column_Container');
|
||||
$this->assertArrayHasKey(
|
||||
'text',
|
||||
$parent->links
|
||||
);
|
||||
$this->assertContains(
|
||||
'tbl_structure.php',
|
||||
$parent->links['text']
|
||||
);
|
||||
$this->assertEquals('columns', $parent->real_name);
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -32,20 +32,5 @@ class Node_Column_Test extends PHPUnit_Framework_TestCase
|
||||
$parent->links['text']
|
||||
);
|
||||
}
|
||||
|
||||
public function testAddNode()
|
||||
{
|
||||
$parent = PMA_NodeFactory::getInstance('Node_Column', 'parent');
|
||||
$child = PMA_NodeFactory::getInstance('Node_Column', 'child');
|
||||
$parent->addChild($child);
|
||||
$this->assertEquals(
|
||||
$parent->getChild($child->name),
|
||||
$child
|
||||
);
|
||||
$this->assertEquals(
|
||||
$parent->getChild($child->real_name, true),
|
||||
$child
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
37
test/classes/navigation/PMA_Node_Event_Container_test.php
Normal file
37
test/classes/navigation/PMA_Node_Event_Container_test.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* tests for NodeFactory class and Node_Column class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
require_once 'libraries/navigation/NodeFactory.class.php';
|
||||
require_once 'libraries/Util.class.php';
|
||||
require_once 'libraries/Theme.class.php';
|
||||
|
||||
|
||||
class Node_Event_Container_Test extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setup()
|
||||
{
|
||||
$GLOBALS['server'] = 0;
|
||||
$GLOBALS['token'] = 'token';
|
||||
$_SESSION['PMA_Theme'] = PMA_Theme::load('./themes/pmahomme');
|
||||
}
|
||||
|
||||
public function testConstructor()
|
||||
{
|
||||
$parent = PMA_NodeFactory::getInstance('Node_Event_Container');
|
||||
$this->assertArrayHasKey(
|
||||
'text',
|
||||
$parent->links
|
||||
);
|
||||
$this->assertContains(
|
||||
'db_events.php',
|
||||
$parent->links['text']
|
||||
);
|
||||
$this->assertEquals('events', $parent->real_name);
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user