2012-07-12 20:40:06 -04:00
|
|
|
<?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';
|
|
|
|
|
|
|
|
|
|
/**
|
2012-07-12 22:34:02 -04:00
|
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:24.
|
2012-07-12 20:40:06 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class classxmlformTemplateTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var xmlformTemplate
|
|
|
|
|
*/
|
|
|
|
|
protected $object;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
|
|
|
* This method is called before a test is executed.
|
|
|
|
|
*/
|
|
|
|
|
protected function setUp()
|
|
|
|
|
{
|
2012-07-13 07:49:11 -04:00
|
|
|
$form = '';
|
|
|
|
|
$templateFile = '';
|
|
|
|
|
$this->object = new xmlformTemplate(&$form, $templateFile);
|
2012-07-12 20:40:06 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Tears down the fixture, for example, closes a network connection.
|
|
|
|
|
* This method is called after a test is executed.
|
|
|
|
|
*/
|
|
|
|
|
protected function tearDown()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2012-07-13 07:49:11 -04:00
|
|
|
* This is the default method to test, if the class still having
|
2012-07-12 20:40:06 -04:00
|
|
|
* the same number of methods.
|
|
|
|
|
*/
|
|
|
|
|
public function testNumberOfMethodsInThisClass()
|
|
|
|
|
{
|
2012-07-12 22:34:02 -04:00
|
|
|
$methods = get_class_methods('xmlformTemplate'); $this->assertTrue( count($methods) == 68);
|
2012-07-12 20:40:06 -04:00
|
|
|
}
|
|
|
|
|
|
2012-05-10 20:51:34 -04:00
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::xmlformTemplate
|
|
|
|
|
* @todo Implement testxmlformTemplate().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testxmlformTemplate()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('xmlformTemplate', $methods ), 'exists method xmlformTemplate' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', 'xmlformTemplate');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'form');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'templateFile');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::printTemplate
|
|
|
|
|
* @todo Implement testprintTemplate().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testprintTemplate()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('printTemplate', $methods ), 'exists method printTemplate' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', 'printTemplate');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'form');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'target');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
|
|
|
$this->assertTrue( $params[1]->getDefaultValue() == 'smarty');
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::printJavaScript
|
|
|
|
|
* @todo Implement testprintJavaScript().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testprintJavaScript()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('printJavaScript', $methods ), 'exists method printJavaScript' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', 'printJavaScript');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'form');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::printJSFile
|
|
|
|
|
* @todo Implement testprintJSFile().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testprintJSFile()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('printJSFile', $methods ), 'exists method printJSFile' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', 'printJSFile');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'form');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::getFields
|
|
|
|
|
* @todo Implement testgetFields().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetFields()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('getFields', $methods ), 'exists method getFields' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', 'getFields');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'form');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'therow');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
|
|
|
$this->assertTrue( $params[1]->getDefaultValue() == '-1');
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::printObject
|
|
|
|
|
* @todo Implement testprintObject().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testprintObject()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('printObject', $methods ), 'exists method printObject' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', 'printObject');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'form');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'therow');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
|
|
|
$this->assertTrue( $params[1]->getDefaultValue() == '-1');
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::_get_template
|
|
|
|
|
* @todo Implement test_get_template().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function test_get_template()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('_get_template', $methods ), 'exists method _get_template' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', '_get_template');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'tpl_name');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'tpl_source');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[2]->getName() == 'smarty_obj');
|
|
|
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[2]->isOptional () == false);
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::_get_timestamp
|
|
|
|
|
* @todo Implement test_get_timestamp().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function test_get_timestamp()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('_get_timestamp', $methods ), 'exists method _get_timestamp' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', '_get_timestamp');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'tpl_name');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'tpl_timestamp');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[2]->getName() == 'smarty_obj');
|
|
|
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[2]->isOptional () == false);
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::_get_secure
|
|
|
|
|
* @todo Implement test_get_secure().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function test_get_secure()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('_get_secure', $methods ), 'exists method _get_secure' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', '_get_secure');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'tpl_name');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'smarty_obj');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers xmlformTemplate::_get_trusted
|
|
|
|
|
* @todo Implement test_get_trusted().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function test_get_trusted()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('_get_trusted', $methods ), 'exists method _get_trusted' );
|
|
|
|
|
$r = new ReflectionMethod('xmlformTemplate', '_get_trusted');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'tpl_name');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'smarty_obj');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|
2012-05-10 20:51:34 -04:00
|
|
|
|
2012-07-13 07:49:11 -04:00
|
|
|
}
|