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 . 'workflow/engine/classes/class.derivation.php';
|
2012-05-10 20:57:25 -04:00
|
|
|
|
2012-07-12 20:40:06 -04:00
|
|
|
/**
|
2012-07-12 22:34:02 -04:00
|
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:25.
|
2012-07-12 20:40:06 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class classDerivationTest extends PHPUnit_Framework_TestCase
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @var Derivation
|
|
|
|
|
*/
|
|
|
|
|
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 Derivation();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 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 18:35:28 -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-13 18:35:28 -04:00
|
|
|
$methods = get_class_methods('Derivation');
|
2012-10-04 14:03:12 -04:00
|
|
|
$this->assertTrue(count($methods) == 14, count($methods));
|
2012-07-12 20:40:06 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::prepareInformation
|
|
|
|
|
* @todo Implement testprepareInformation().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testprepareInformation()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('prepareInformation', $methods ), 'exists method prepareInformation' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'prepareInformation');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'aData');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:35:28 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::getRouteCondition
|
|
|
|
|
* @todo Implement testgetRouteCondition().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetRouteCondition()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('getRouteCondition', $methods ), 'exists method getRouteCondition' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'getRouteCondition');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'aData');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:35:28 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::GetAppParentIndex
|
|
|
|
|
* @todo Implement testGetAppParentIndex().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testGetAppParentIndex()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('GetAppParentIndex', $methods ), 'exists method GetAppParentIndex' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'GetAppParentIndex');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'aData');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:35:28 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::getAllUsersFromAnyTask
|
|
|
|
|
* @todo Implement testgetAllUsersFromAnyTask().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetAllUsersFromAnyTask()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('getAllUsersFromAnyTask', $methods ), 'exists method getAllUsersFromAnyTask' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'getAllUsersFromAnyTask');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'sTasUid');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:35:28 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::getUsersFullNameFromArray
|
|
|
|
|
* @todo Implement testgetUsersFullNameFromArray().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetUsersFullNameFromArray()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
2012-07-13 18:35:28 -04:00
|
|
|
$this->assertTrue(in_array('getUsersFullNameFromArray', $methods), 'exists method getUsersFullNameFromArray');
|
2012-07-12 20:40:06 -04:00
|
|
|
$r = new ReflectionMethod('Derivation', 'getUsersFullNameFromArray');
|
2012-07-13 18:35:28 -04:00
|
|
|
|
2012-07-12 20:40:06 -04:00
|
|
|
$params = $r->getParameters();
|
2012-07-13 18:35:28 -04:00
|
|
|
$this->assertTrue($params[0]->getName() == 'aUsers');
|
|
|
|
|
$this->assertTrue($params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue($params[0]->isOptional() == false);
|
|
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::getNextAssignedUser
|
|
|
|
|
* @todo Implement testgetNextAssignedUser().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetNextAssignedUser()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('getNextAssignedUser', $methods ), 'exists method getNextAssignedUser' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'getNextAssignedUser');
|
2012-07-13 18:35:28 -04:00
|
|
|
|
2012-07-12 20:40:06 -04:00
|
|
|
$params = $r->getParameters();
|
2012-07-13 18:35:28 -04:00
|
|
|
$this->assertTrue($params[0]->getName() == 'tasInfo');
|
|
|
|
|
$this->assertTrue($params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue($params[0]->isOptional() == false);
|
|
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::getDenpendentUser
|
|
|
|
|
* @todo Implement testgetDenpendentUser().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetDenpendentUser()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('getDenpendentUser', $methods ), 'exists method getDenpendentUser' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'getDenpendentUser');
|
2012-07-13 18:35:28 -04:00
|
|
|
|
2012-07-12 20:40:06 -04:00
|
|
|
$params = $r->getParameters();
|
2012-07-13 18:35:28 -04:00
|
|
|
$this->assertTrue($params[0]->getName() == 'USR_UID');
|
|
|
|
|
$this->assertTrue($params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue($params[0]->isOptional() == false);
|
|
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::setTasLastAssigned
|
|
|
|
|
* @todo Implement testsetTasLastAssigned().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testsetTasLastAssigned()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('setTasLastAssigned', $methods ), 'exists method setTasLastAssigned' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'setTasLastAssigned');
|
2012-07-13 18:35:28 -04:00
|
|
|
|
2012-07-12 20:40:06 -04:00
|
|
|
$params = $r->getParameters();
|
2012-07-13 18:35:28 -04:00
|
|
|
$this->assertTrue($params[0]->getName() == 'tasUid');
|
|
|
|
|
$this->assertTrue($params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue($params[0]->isOptional() == false);
|
|
|
|
|
$this->assertTrue($params[1]->getName() == 'usrUid');
|
|
|
|
|
$this->assertTrue($params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue($params[1]->isOptional() == false);
|
|
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::derivate
|
|
|
|
|
* @todo Implement testderivate().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testderivate()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('derivate', $methods ), 'exists method derivate' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'derivate');
|
2012-07-13 18:35:28 -04:00
|
|
|
|
2012-07-12 20:40:06 -04:00
|
|
|
$params = $r->getParameters();
|
2012-07-13 18:35:28 -04:00
|
|
|
$this->assertTrue($params[0]->getName() == 'currentDelegation');
|
|
|
|
|
$this->assertTrue($params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue($params[0]->isOptional() == true);
|
|
|
|
|
$this->assertTrue($params[0]->getDefaultValue() == array());
|
|
|
|
|
$this->assertTrue($params[1]->getName() == 'nextDelegations');
|
|
|
|
|
$this->assertTrue($params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue($params[1]->isOptional() == true);
|
|
|
|
|
$this->assertTrue($params[1]->getDefaultValue() == array());
|
|
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::doDerivation
|
|
|
|
|
* @todo Implement testdoDerivation().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testdoDerivation()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('doDerivation', $methods ), 'exists method doDerivation' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'doDerivation');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'currentDelegation');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'nextDel');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[2]->getName() == 'appFields');
|
|
|
|
|
$this->assertTrue( $params[2]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[2]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[3]->getName() == 'aSP');
|
|
|
|
|
$this->assertTrue( $params[3]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[3]->isOptional () == true);
|
|
|
|
|
$this->assertTrue( $params[3]->getDefaultValue() == '');
|
2012-07-13 18:35:28 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::verifyIsCaseChild
|
|
|
|
|
* @todo Implement testverifyIsCaseChild().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testverifyIsCaseChild()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('verifyIsCaseChild', $methods ), 'exists method verifyIsCaseChild' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'verifyIsCaseChild');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'sApplicationUID');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:35:28 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::getDerivatedCases
|
|
|
|
|
* @todo Implement testgetDerivatedCases().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetDerivatedCases()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('getDerivatedCases', $methods ), 'exists method getDerivatedCases' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'getDerivatedCases');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'sParentUid');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
|
|
|
$this->assertTrue( $params[1]->getName() == 'sDelIndexParent');
|
|
|
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[1]->isOptional () == false);
|
2012-07-13 18:35:28 -04:00
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @covers Derivation::getGrpUser
|
|
|
|
|
* @todo Implement testgetGrpUser().
|
|
|
|
|
*/
|
2012-07-12 20:40:06 -04:00
|
|
|
public function testgetGrpUser()
|
|
|
|
|
{
|
|
|
|
|
$methods = get_class_methods($this->object);
|
|
|
|
|
$this->assertTrue( in_array('getGrpUser', $methods ), 'exists method getGrpUser' );
|
|
|
|
|
$r = new ReflectionMethod('Derivation', 'getGrpUser');
|
|
|
|
|
$params = $r->getParameters();
|
|
|
|
|
$this->assertTrue( $params[0]->getName() == 'aData');
|
|
|
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
|
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
2012-07-13 18:35:28 -04:00
|
|
|
}
|
|
|
|
|
}
|
2012-05-10 20:57:25 -04:00
|
|
|
|