Files
luos/old_tests/automated/gulliver/system/classMenuTest.php
davidcallizaya bfc0be7e44 HOR-3207
Change web entry model.
2017-06-03 12:45:03 -04:00

271 lines
11 KiB
PHP

<?php
require_once PATH_TRUNK . 'gulliver/thirdparty/smarty/libs/Smarty.class.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlform.php';
require_once PATH_TRUNK . 'gulliver/system/class.xmlDocument.php';
require_once PATH_TRUNK . 'gulliver/system/class.form.php';
require_once PATH_TRUNK . 'gulliver/system/class.dbconnection.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/propel/Propel.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/creole/Creole.php';
require_once PATH_TRUNK . 'gulliver/thirdparty/pear/PEAR.php';
require_once PATH_TRUNK . 'gulliver/system/class.menu.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:24.
*/
class classMenuTest extends PHPUnit_Framework_TestCase
{
/**
* @var Menu
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$this->object = new Menu();
}
/**
* Tears down the fixture, for example, closes a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
{
}
/**
* This is the default method to test, if the class still having
* the same number of methods.
*/
public function testNumberOfMethodsInThisClass()
{
$methods = get_class_methods('Menu'); $this->assertTrue( count($methods) == 11);
}
/**
* @covers Menu::SetClass
* @todo Implement testSetClass().
*/
public function testSetClass()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('SetClass', $methods ), 'exists method SetClass' );
$r = new ReflectionMethod('Menu', 'SetClass');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'strClass');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == 'mnu');
}
/**
* @covers Menu::Load
* @todo Implement testLoad().
*/
public function testLoad()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('Load', $methods ), 'exists method Load' );
$r = new ReflectionMethod('Menu', 'Load');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'strMenuName');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Menu::OptionCount
* @todo Implement testOptionCount().
*/
public function testOptionCount()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('OptionCount', $methods ), 'exists method OptionCount' );
$r = new ReflectionMethod('Menu', 'OptionCount');
$params = $r->getParameters();
}
/**
* @covers Menu::AddOption
* @todo Implement testAddOption().
*/
public function testAddOption()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('AddOption', $methods ), 'exists method AddOption' );
$r = new ReflectionMethod('Menu', 'AddOption');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'strLabel');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'strURL');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'strType');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == 'plugins');
}
/**
* @covers Menu::AddIdOption
* @todo Implement testAddIdOption().
*/
public function testAddIdOption()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('AddIdOption', $methods ), 'exists method AddIdOption' );
$r = new ReflectionMethod('Menu', 'AddIdOption');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'strId');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'strLabel');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'strURL');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->assertTrue( $params[3]->getName() == 'strType');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == 'plugins');
}
/**
* @covers Menu::AddRawOption
* @todo Implement testAddRawOption().
*/
public function testAddRawOption()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('AddRawOption', $methods ), 'exists method AddRawOption' );
$r = new ReflectionMethod('Menu', 'AddRawOption');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'strURL');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
$this->assertTrue( $params[1]->getName() == 'strType');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == 'plugins');
}
/**
* @covers Menu::AddIdRawOption
* @todo Implement testAddIdRawOption().
*/
public function testAddIdRawOption()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('AddIdRawOption', $methods ), 'exists method AddIdRawOption' );
$r = new ReflectionMethod('Menu', 'AddIdRawOption');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'strId');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'strURL');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
$this->assertTrue( $params[2]->getName() == 'label');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == '');
$this->assertTrue( $params[3]->getName() == 'icon');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '');
$this->assertTrue( $params[4]->getName() == 'js');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == true);
$this->assertTrue( $params[4]->getDefaultValue() == '');
$this->assertTrue( $params[5]->getName() == 'strType');
$this->assertTrue( $params[5]->isArray() == false);
$this->assertTrue( $params[5]->isOptional () == true);
$this->assertTrue( $params[5]->getDefaultValue() == 'plugins');
$this->assertTrue( $params[6]->getName() == 'elementClass');
$this->assertTrue( $params[6]->isArray() == false);
$this->assertTrue( $params[6]->isOptional () == true);
$this->assertTrue( $params[6]->getDefaultValue() == '');
}
/**
* @covers Menu::DisableOptionPos
* @todo Implement testDisableOptionPos().
*/
public function testDisableOptionPos()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('DisableOptionPos', $methods ), 'exists method DisableOptionPos' );
$r = new ReflectionMethod('Menu', 'DisableOptionPos');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'intPos');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Menu::DisableOptionId
* @todo Implement testDisableOptionId().
*/
public function testDisableOptionId()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('DisableOptionId', $methods ), 'exists method DisableOptionId' );
$r = new ReflectionMethod('Menu', 'DisableOptionId');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'id');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Menu::RenderOption
* @todo Implement testRenderOption().
*/
public function testRenderOption()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('RenderOption', $methods ), 'exists method RenderOption' );
$r = new ReflectionMethod('Menu', 'RenderOption');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'intPos');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers Menu::generateArrayForTemplate
* @todo Implement testgenerateArrayForTemplate().
*/
public function testgenerateArrayForTemplate()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('generateArrayForTemplate', $methods ), 'exists method generateArrayForTemplate' );
$r = new ReflectionMethod('Menu', 'generateArrayForTemplate');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'G_MAIN_MENU');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'classOn');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
$this->assertTrue( $params[2]->getName() == 'classOff');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == false);
$this->assertTrue( $params[3]->getName() == 'G_MENU_SELECTED');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == false);
$this->assertTrue( $params[4]->getName() == 'G_ID_MENU_SELECTED');
$this->assertTrue( $params[4]->isArray() == false);
$this->assertTrue( $params[4]->isOptional () == false);
}
}