382 lines
16 KiB
PHP
382 lines
16 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 . 'workflow/engine/classes/class.dynaformEditor.php';
|
|
|
|
/**
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:31.
|
|
*/
|
|
|
|
class classdynaformEditorAjaxTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @var dynaformEditorAjax
|
|
*/
|
|
protected $object;
|
|
|
|
/**
|
|
* Sets up the fixture, for example, opens a network connection.
|
|
* This method is called before a test is executed.
|
|
*/
|
|
protected function setUp()
|
|
{
|
|
$post = '';
|
|
$_SERVER['REQUEST_URI'] = '';
|
|
//disabling the instance of this method,
|
|
//because it is calling Headers, and there is no way
|
|
//to phpunit avoid the headers for the moment.
|
|
//$this->object = new dynaformEditorAjax($post);
|
|
}
|
|
|
|
/**
|
|
* 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('dynaformEditorAjax');
|
|
$this->assertTrue( count($methods) == 28);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::dynaformEditorAjax
|
|
* @todo Implement testdynaformEditorAjax().
|
|
*/
|
|
public function testdynaformEditorAjax()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('dynaformEditorAjax', $methods ), 'exists method dynaformEditorAjax' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'dynaformEditorAjax');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'post');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::_run
|
|
* @todo Implement test_run().
|
|
*/
|
|
public function test_run()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('_run', $methods ), 'exists method _run' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', '_run');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'post');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::render_preview
|
|
* @todo Implement testrender_preview().
|
|
*/
|
|
public function testrender_preview()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('render_preview', $methods ), 'exists method render_preview' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'render_preview');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::render_htmledit
|
|
* @todo Implement testrender_htmledit().
|
|
*/
|
|
public function testrender_htmledit()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('render_htmledit', $methods ), 'exists method render_htmledit' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'render_htmledit');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::get_htmlcode
|
|
* @todo Implement testget_htmlcode().
|
|
*/
|
|
public function testget_htmlcode()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('get_htmlcode', $methods ), 'exists method get_htmlcode' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'get_htmlcode');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::restore_html
|
|
* @todo Implement testrestore_html().
|
|
*/
|
|
public function testrestore_html()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('restore_html', $methods ), 'exists method restore_html' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'restore_html');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::set_htmlcode
|
|
* @todo Implement testset_htmlcode().
|
|
*/
|
|
public function testset_htmlcode()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('set_htmlcode', $methods ), 'exists method set_htmlcode' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'set_htmlcode');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'htmlcode');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::get_xmlcode
|
|
* @todo Implement testget_xmlcode().
|
|
*/
|
|
public function testget_xmlcode()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('get_xmlcode', $methods ), 'exists method get_xmlcode' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'get_xmlcode');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::set_xmlcode
|
|
* @todo Implement testset_xmlcode().
|
|
*/
|
|
public function testset_xmlcode()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('set_xmlcode', $methods ), 'exists method set_xmlcode' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'set_xmlcode');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'xmlcode');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::get_javascripts
|
|
* @todo Implement testget_javascripts().
|
|
*/
|
|
public function testget_javascripts()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('get_javascripts', $methods ), 'exists method get_javascripts' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'get_javascripts');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'fieldName');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::set_javascript
|
|
* @todo Implement testset_javascript().
|
|
*/
|
|
public function testset_javascript()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('set_javascript', $methods ), 'exists method set_javascript' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'set_javascript');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'fieldName');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
$this->assertTrue( $params[2]->getName() == 'sCode');
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
$this->assertTrue( $params[2]->isOptional () == false);
|
|
$this->assertTrue( $params[3]->getName() == 'meta');
|
|
$this->assertTrue( $params[3]->isArray() == false);
|
|
$this->assertTrue( $params[3]->isOptional () == true);
|
|
$this->assertTrue( $params[3]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::get_properties
|
|
* @todo Implement testget_properties().
|
|
*/
|
|
public function testget_properties()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('get_properties', $methods ), 'exists method get_properties' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'get_properties');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'DYN_UID');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::set_properties
|
|
* @todo Implement testset_properties().
|
|
*/
|
|
public function testset_properties()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('set_properties', $methods ), 'exists method set_properties' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'set_properties');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'DYN_UID');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
$this->assertTrue( $params[2]->getName() == 'getFields');
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
$this->assertTrue( $params[2]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::get_enabletemplate
|
|
* @todo Implement testget_enabletemplate().
|
|
*/
|
|
public function testget_enabletemplate()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('get_enabletemplate', $methods ), 'exists method get_enabletemplate' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'get_enabletemplate');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::set_enabletemplate
|
|
* @todo Implement testset_enabletemplate().
|
|
*/
|
|
public function testset_enabletemplate()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('set_enabletemplate', $methods ), 'exists method set_enabletemplate' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'set_enabletemplate');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$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 dynaformEditorAjax::save
|
|
* @todo Implement testsave().
|
|
*/
|
|
public function testsave()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('save', $methods ), 'exists method save' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'save');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'DYN_UID');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::close
|
|
* @todo Implement testclose().
|
|
*/
|
|
public function testclose()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('close', $methods ), 'exists method close' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'close');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers dynaformEditorAjax::is_modified
|
|
* @todo Implement testis_modified().
|
|
* @ run InSeparateProcess
|
|
*/
|
|
public function testis_modified()
|
|
{
|
|
//$methods = get_class_methods($this->object);
|
|
$methods = get_class_methods('dynaformEditorAjax');
|
|
$this->assertTrue( in_array('is_modified', $methods ), 'exists method is_modified' );
|
|
$r = new ReflectionMethod('dynaformEditorAjax', 'is_modified');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'A');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'DYN_UID');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
}
|
|
|
|
}
|