199 lines
9.0 KiB
PHP
199 lines
9.0 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.applications.php';
|
|
|
|
/**
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:24.
|
|
*/
|
|
|
|
class classApplicationsTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @var Applications
|
|
*/
|
|
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 Applications();
|
|
}
|
|
|
|
/**
|
|
* 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('Applications'); $this->assertTrue( count($methods) == 5);
|
|
}
|
|
|
|
/**
|
|
* @covers Applications::getAll
|
|
* @todo Implement testgetAll().
|
|
*/
|
|
public function testgetAll()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getAll', $methods ), 'exists method getAll' );
|
|
$r = new ReflectionMethod('Applications', 'getAll');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'userUid');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'start');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
$this->assertTrue( $params[1]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[2]->getName() == 'limit');
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
$this->assertTrue( $params[2]->isOptional () == true);
|
|
$this->assertTrue( $params[2]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[3]->getName() == 'action');
|
|
$this->assertTrue( $params[3]->isArray() == false);
|
|
$this->assertTrue( $params[3]->isOptional () == true);
|
|
$this->assertTrue( $params[3]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[4]->getName() == 'filter');
|
|
$this->assertTrue( $params[4]->isArray() == false);
|
|
$this->assertTrue( $params[4]->isOptional () == true);
|
|
$this->assertTrue( $params[4]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[5]->getName() == 'search');
|
|
$this->assertTrue( $params[5]->isArray() == false);
|
|
$this->assertTrue( $params[5]->isOptional () == true);
|
|
$this->assertTrue( $params[5]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[6]->getName() == 'process');
|
|
$this->assertTrue( $params[6]->isArray() == false);
|
|
$this->assertTrue( $params[6]->isOptional () == true);
|
|
$this->assertTrue( $params[6]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[7]->getName() == 'status');
|
|
$this->assertTrue( $params[7]->isArray() == false);
|
|
$this->assertTrue( $params[7]->isOptional () == true);
|
|
$this->assertTrue( $params[7]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[8]->getName() == 'type');
|
|
$this->assertTrue( $params[8]->isArray() == false);
|
|
$this->assertTrue( $params[8]->isOptional () == true);
|
|
$this->assertTrue( $params[8]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[9]->getName() == 'dateFrom');
|
|
$this->assertTrue( $params[9]->isArray() == false);
|
|
$this->assertTrue( $params[9]->isOptional () == true);
|
|
$this->assertTrue( $params[9]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[10]->getName() == 'dateTo');
|
|
$this->assertTrue( $params[10]->isArray() == false);
|
|
$this->assertTrue( $params[10]->isOptional () == true);
|
|
$this->assertTrue( $params[10]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[11]->getName() == 'callback');
|
|
$this->assertTrue( $params[11]->isArray() == false);
|
|
$this->assertTrue( $params[11]->isOptional () == true);
|
|
$this->assertTrue( $params[11]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[12]->getName() == 'dir');
|
|
$this->assertTrue( $params[12]->isArray() == false);
|
|
$this->assertTrue( $params[12]->isOptional () == true);
|
|
$this->assertTrue( $params[12]->getDefaultValue() == '');
|
|
$this->assertTrue( $params[13]->getName() == 'sort');
|
|
$this->assertTrue( $params[13]->isArray() == false);
|
|
$this->assertTrue( $params[13]->isOptional () == true);
|
|
$this->assertTrue( $params[13]->getDefaultValue() == 'APP_CACHE_VIEW.APP_NUMBER');
|
|
$this->assertTrue( $params[14]->getName() == 'category');
|
|
$this->assertTrue( $params[14]->isArray() == false);
|
|
$this->assertTrue( $params[14]->isOptional () == true);
|
|
$this->assertTrue( $params[14]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Applications::setDefaultFields
|
|
* @todo Implement testsetDefaultFields().
|
|
*/
|
|
public function testsetDefaultFields()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('setDefaultFields', $methods ), 'exists method setDefaultFields' );
|
|
$r = new ReflectionMethod('Applications', 'setDefaultFields');
|
|
$params = $r->getParameters();
|
|
}
|
|
|
|
/**
|
|
* @covers Applications::getDefaultFields
|
|
* @todo Implement testgetDefaultFields().
|
|
*/
|
|
public function testgetDefaultFields()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getDefaultFields', $methods ), 'exists method getDefaultFields' );
|
|
$r = new ReflectionMethod('Applications', 'getDefaultFields');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'action');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Applications::genericJsonResponse
|
|
* @todo Implement testgenericJsonResponse().
|
|
*/
|
|
public function testgenericJsonResponse()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('genericJsonResponse', $methods ), 'exists method genericJsonResponse' );
|
|
$r = new ReflectionMethod('Applications', 'genericJsonResponse');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'pmtable');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'first');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
$this->assertTrue( $params[2]->getName() == 'second');
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
$this->assertTrue( $params[2]->isOptional () == false);
|
|
$this->assertTrue( $params[3]->getName() == 'rowsperpage');
|
|
$this->assertTrue( $params[3]->isArray() == false);
|
|
$this->assertTrue( $params[3]->isOptional () == false);
|
|
$this->assertTrue( $params[4]->getName() == 'dateFormat');
|
|
$this->assertTrue( $params[4]->isArray() == false);
|
|
$this->assertTrue( $params[4]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Applications::getSteps
|
|
* @todo Implement testgetSteps().
|
|
*/
|
|
public function testgetSteps()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getSteps', $methods ), 'exists method getSteps' );
|
|
$r = new ReflectionMethod('Applications', 'getSteps');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'appUid');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'index');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
$this->assertTrue( $params[2]->getName() == 'tasUid');
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
$this->assertTrue( $params[2]->isOptional () == false);
|
|
$this->assertTrue( $params[3]->getName() == 'proUid');
|
|
$this->assertTrue( $params[3]->isArray() == false);
|
|
$this->assertTrue( $params[3]->isOptional () == false);
|
|
}
|
|
|
|
}
|