Files
luos/tests/automated/gulliver/system/classXmlForm_FieldTest.php
Julio Cesar Laura 2b17844f64 Fix the unit tests
2013-02-28 12:48:40 -04:00

461 lines
19 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.xmlform.php';
/**
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:23.
*/
class classXmlForm_FieldTest extends PHPUnit_Framework_TestCase
{
/**
* @var XmlForm_Field
*/
protected $object;
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
$attributes = array('type'=>'input');
$fieldNode = new Xml_Node('testField', 'type', 'value', $attributes);
$this->object = new XmlForm_Field($fieldNode);
}
/**
* 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('XmlForm_Field'); $this->assertTrue( count($methods) == 25);
}
/**
* @covers XmlForm_Field::XmlForm_Field
* @todo Implement testXmlForm_Field().
*/
public function testXmlForm_Field()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('XmlForm_Field', $methods ), 'exists method XmlForm_Field' );
$r = new ReflectionMethod('XmlForm_Field', 'XmlForm_Field');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'xmlNode');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'lang');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == 'en');
$this->assertTrue( $params[2]->getName() == 'home');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == '');
$this->assertTrue( $params[3]->getName() == 'owner');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::validateValue
* @todo Implement testvalidateValue().
*/
public function testvalidateValue()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('validateValue', $methods ), 'exists method validateValue' );
$r = new ReflectionMethod('XmlForm_Field', 'validateValue');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'value');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers XmlForm_Field::executeSQL
* @todo Implement testexecuteSQL().
*/
public function testexecuteSQL()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('executeSQL', $methods ), 'exists method executeSQL' );
$r = new ReflectionMethod('XmlForm_Field', 'executeSQL');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'owner');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'row');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '-1');
}
/**
* @covers XmlForm_Field::htmlentities
* @todo Implement testhtmlentities().
*/
public function testhtmlentities()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('htmlentities', $methods ), 'exists method htmlentities' );
$r = new ReflectionMethod('XmlForm_Field', 'htmlentities');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'value');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'flags');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '3');
$this->assertTrue( $params[2]->getName() == 'encoding');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == 'utf-8');
}
/**
* @covers XmlForm_Field::render
* @todo Implement testrender().
*/
public function testrender()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('render', $methods ), 'exists method render' );
$r = new ReflectionMethod('XmlForm_Field', 'render');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'value');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::renderGrid
* @todo Implement testrenderGrid().
*/
public function testrenderGrid()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('renderGrid', $methods ), 'exists method renderGrid' );
$r = new ReflectionMethod('XmlForm_Field', 'renderGrid');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'values');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == Array());
$this->assertTrue( $params[1]->getName() == 'owner');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
$this->assertTrue( $params[2]->getName() == 'onlyValue');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == '');
$this->assertTrue( $params[3]->getName() == 'therow');
$this->assertTrue( $params[3]->isArray() == false);
$this->assertTrue( $params[3]->isOptional () == true);
$this->assertTrue( $params[3]->getDefaultValue() == '-1');
}
/**
* @covers XmlForm_Field::renderTable
* @todo Implement testrenderTable().
*/
public function testrenderTable()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('renderTable', $methods ), 'exists method renderTable' );
$r = new ReflectionMethod('XmlForm_Field', 'renderTable');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'values');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
$this->assertTrue( $params[1]->getName() == 'owner');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
$this->assertTrue( $params[2]->getName() == 'onlyValue');
$this->assertTrue( $params[2]->isArray() == false);
$this->assertTrue( $params[2]->isOptional () == true);
$this->assertTrue( $params[2]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::dependentOf
* @todo Implement testdependentOf().
*/
public function testdependentOf()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('dependentOf', $methods ), 'exists method dependentOf' );
$r = new ReflectionMethod('XmlForm_Field', 'dependentOf');
$params = $r->getParameters();
}
/**
* @covers XmlForm_Field::mask
* @todo Implement testmask().
*/
public function testmask()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('mask', $methods ), 'exists method mask' );
$r = new ReflectionMethod('XmlForm_Field', 'mask');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'format');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'value');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers XmlForm_Field::getAttributes
* @todo Implement testgetAttributes().
*/
public function testgetAttributes()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getAttributes', $methods ), 'exists method getAttributes' );
$r = new ReflectionMethod('XmlForm_Field', 'getAttributes');
$params = $r->getParameters();
}
/**
* @covers XmlForm_Field::getEvents
* @todo Implement testgetEvents().
*/
public function testgetEvents()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getEvents', $methods ), 'exists method getEvents' );
$r = new ReflectionMethod('XmlForm_Field', 'getEvents');
$params = $r->getParameters();
}
/**
* @covers XmlForm_Field::attachEvents
* @todo Implement testattachEvents().
*/
public function testattachEvents()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('attachEvents', $methods ), 'exists method attachEvents' );
$r = new ReflectionMethod('XmlForm_Field', 'attachEvents');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'elementRef');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers XmlForm_Field::createXmlNode
* @todo Implement testcreateXmlNode().
*/
public function testcreateXmlNode()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('createXmlNode', $methods ), 'exists method createXmlNode' );
$r = new ReflectionMethod('XmlForm_Field', 'createXmlNode');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'includeDefaultValues');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::updateXmlNode
* @todo Implement testupdateXmlNode().
*/
public function testupdateXmlNode()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('updateXmlNode', $methods ), 'exists method updateXmlNode' );
$r = new ReflectionMethod('XmlForm_Field', 'updateXmlNode');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'node');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'includeDefaultValues');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == true);
$this->assertTrue( $params[1]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::getXmlAttributes
* @todo Implement testgetXmlAttributes().
*/
public function testgetXmlAttributes()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getXmlAttributes', $methods ), 'exists method getXmlAttributes' );
$r = new ReflectionMethod('XmlForm_Field', 'getXmlAttributes');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'includeDefaultValues');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::maskValue
* @todo Implement testmaskValue().
*/
public function testmaskValue()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('maskValue', $methods ), 'exists method maskValue' );
$r = new ReflectionMethod('XmlForm_Field', 'maskValue');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'value');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
$this->assertTrue( $params[1]->getName() == 'owner');
$this->assertTrue( $params[1]->isArray() == false);
$this->assertTrue( $params[1]->isOptional () == false);
}
/**
* @covers XmlForm_Field::cloneObject
* @todo Implement testcloneObject().
*/
public function testcloneObject()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('cloneObject', $methods ), 'exists method cloneObject' );
$r = new ReflectionMethod('XmlForm_Field', 'cloneObject');
$params = $r->getParameters();
}
/**
* @covers XmlForm_Field::getPMTableValue
* @todo Implement testgetPMTableValue().
*/
public function testgetPMTableValue()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('getPMTableValue', $methods ), 'exists method getPMTableValue' );
$r = new ReflectionMethod('XmlForm_Field', 'getPMTableValue');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'oOwner');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == false);
}
/**
* @covers XmlForm_Field::NSRequiredValue
* @todo Implement testNSRequiredValue().
*/
public function testNSRequiredValue()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('NSRequiredValue', $methods ), 'exists method NSRequiredValue' );
$r = new ReflectionMethod('XmlForm_Field', 'NSRequiredValue');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'show');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::NSGridLabel
* @todo Implement testNSGridLabel().
*/
public function testNSGridLabel()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('NSGridLabel', $methods ), 'exists method NSGridLabel' );
$r = new ReflectionMethod('XmlForm_Field', 'NSGridLabel');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'show');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::NSDefaultValue
* @todo Implement testNSDefaultValue().
*/
public function testNSDefaultValue()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('NSDefaultValue', $methods ), 'exists method NSDefaultValue' );
$r = new ReflectionMethod('XmlForm_Field', 'NSDefaultValue');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'show');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::NSGridType
* @todo Implement testNSGridType().
*/
public function testNSGridType()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('NSGridType', $methods ), 'exists method NSGridType' );
$r = new ReflectionMethod('XmlForm_Field', 'NSGridType');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'show');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::NSDependentFields
* @todo Implement testNSDependentFields().
*/
public function testNSDependentFields()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('NSDependentFields', $methods ), 'exists method NSDependentFields' );
$r = new ReflectionMethod('XmlForm_Field', 'NSDependentFields');
$params = $r->getParameters();
$this->assertTrue( $params[0]->getName() == 'show');
$this->assertTrue( $params[0]->isArray() == false);
$this->assertTrue( $params[0]->isOptional () == true);
$this->assertTrue( $params[0]->getDefaultValue() == '');
}
/**
* @covers XmlForm_Field::renderHint
* @todo Implement testrenderHint().
*/
public function testrenderHint()
{
$methods = get_class_methods($this->object);
$this->assertTrue( in_array('renderHint', $methods ), 'exists method renderHint' );
$r = new ReflectionMethod('XmlForm_Field', 'renderHint');
$params = $r->getParameters();
}
}