Merge pull request #339 from adamgsoc2013/unit_container3

add more container test case
This commit is contained in:
Michal Čihař 2013-05-08 23:42:20 -07:00
commit 4130d22289
3 changed files with 111 additions and 0 deletions

View 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_Table_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_Table_Container');
$this->assertArrayHasKey(
'text',
$parent->links
);
$this->assertContains(
'db_structure.php',
$parent->links['text']
);
$this->assertEquals('tables', $parent->real_name);
}
}
?>

View 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_Trigger_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_Trigger_Container');
$this->assertArrayHasKey(
'text',
$parent->links
);
$this->assertContains(
'db_triggers.php',
$parent->links['text']
);
$this->assertEquals('triggers', $parent->real_name);
}
}
?>

View 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_View_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_View_Container');
$this->assertArrayHasKey(
'text',
$parent->links
);
$this->assertContains(
'db_structure.php',
$parent->links['text']
);
$this->assertEquals('views', $parent->real_name);
}
}
?>