323 lines
13 KiB
PHP
323 lines
13 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.groups.php';
|
|
|
|
/**
|
|
* Generated by ProcessMaker Test Unit Generator on 2012-07-12 at 22:32:25.
|
|
*/
|
|
|
|
class classGroupsTest extends PHPUnit_Framework_TestCase
|
|
{
|
|
/**
|
|
* @var Groups
|
|
*/
|
|
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 Groups();
|
|
}
|
|
|
|
/**
|
|
* 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('Groups'); $this->assertTrue( count($methods) == 17);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getUsersOfGroup
|
|
* @todo Implement testgetUsersOfGroup().
|
|
*/
|
|
public function testgetUsersOfGroup()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getUsersOfGroup', $methods ), 'exists method getUsersOfGroup' );
|
|
$r = new ReflectionMethod('Groups', 'getUsersOfGroup');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sGroupUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getActiveGroupsForAnUser
|
|
* @todo Implement testgetActiveGroupsForAnUser().
|
|
*/
|
|
public function testgetActiveGroupsForAnUser()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getActiveGroupsForAnUser', $methods ), 'exists method getActiveGroupsForAnUser' );
|
|
$r = new ReflectionMethod('Groups', 'getActiveGroupsForAnUser');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sUserUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::addUserToGroup
|
|
* @todo Implement testaddUserToGroup().
|
|
*/
|
|
public function testaddUserToGroup()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('addUserToGroup', $methods ), 'exists method addUserToGroup' );
|
|
$r = new ReflectionMethod('Groups', 'addUserToGroup');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'GrpUid');
|
|
$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);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::removeUserOfGroup
|
|
* @todo Implement testremoveUserOfGroup().
|
|
*/
|
|
public function testremoveUserOfGroup()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('removeUserOfGroup', $methods ), 'exists method removeUserOfGroup' );
|
|
$r = new ReflectionMethod('Groups', 'removeUserOfGroup');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'GrpUid');
|
|
$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);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getAllGroups
|
|
* @todo Implement testgetAllGroups().
|
|
*/
|
|
public function testgetAllGroups()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getAllGroups', $methods ), 'exists method getAllGroups' );
|
|
$r = new ReflectionMethod('Groups', 'getAllGroups');
|
|
$params = $r->getParameters();
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getUserGroups
|
|
* @todo Implement testgetUserGroups().
|
|
*/
|
|
public function testgetUserGroups()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getUserGroups', $methods ), 'exists method getUserGroups' );
|
|
$r = new ReflectionMethod('Groups', 'getUserGroups');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sUserUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getAvailableGroupsCriteria
|
|
* @todo Implement testgetAvailableGroupsCriteria().
|
|
*/
|
|
public function testgetAvailableGroupsCriteria()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getAvailableGroupsCriteria', $methods ), 'exists method getAvailableGroupsCriteria' );
|
|
$r = new ReflectionMethod('Groups', 'getAvailableGroupsCriteria');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sUserUid');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'filter');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
$this->assertTrue( $params[1]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getAssignedGroupsCriteria
|
|
* @todo Implement testgetAssignedGroupsCriteria().
|
|
*/
|
|
public function testgetAssignedGroupsCriteria()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getAssignedGroupsCriteria', $methods ), 'exists method getAssignedGroupsCriteria' );
|
|
$r = new ReflectionMethod('Groups', 'getAssignedGroupsCriteria');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sUserUid');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
$this->assertTrue( $params[1]->getName() == 'filter');
|
|
$this->assertTrue( $params[1]->isArray() == false);
|
|
$this->assertTrue( $params[1]->isOptional () == true);
|
|
$this->assertTrue( $params[1]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getGroupsForUser
|
|
* @todo Implement testgetGroupsForUser().
|
|
*/
|
|
public function testgetGroupsForUser()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getGroupsForUser', $methods ), 'exists method getGroupsForUser' );
|
|
$r = new ReflectionMethod('Groups', 'getGroupsForUser');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'usrUid');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::removeUserOfAllGroups
|
|
* @todo Implement testremoveUserOfAllGroups().
|
|
*/
|
|
public function testremoveUserOfAllGroups()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('removeUserOfAllGroups', $methods ), 'exists method removeUserOfAllGroups' );
|
|
$r = new ReflectionMethod('Groups', 'removeUserOfAllGroups');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sUserUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == true);
|
|
$this->assertTrue( $params[0]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getUsersGroupCriteria
|
|
* @todo Implement testgetUsersGroupCriteria().
|
|
*/
|
|
public function testgetUsersGroupCriteria()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getUsersGroupCriteria', $methods ), 'exists method getUsersGroupCriteria' );
|
|
$r = new ReflectionMethod('Groups', 'getUsersGroupCriteria');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sGroupUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == true);
|
|
$this->assertTrue( $params[0]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getUserGroupsCriteria
|
|
* @todo Implement testgetUserGroupsCriteria().
|
|
*/
|
|
public function testgetUserGroupsCriteria()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getUserGroupsCriteria', $methods ), 'exists method getUserGroupsCriteria' );
|
|
$r = new ReflectionMethod('Groups', 'getUserGroupsCriteria');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sUserUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == true);
|
|
$this->assertTrue( $params[0]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getNumberGroups
|
|
* @todo Implement testgetNumberGroups().
|
|
*/
|
|
public function testgetNumberGroups()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getNumberGroups', $methods ), 'exists method getNumberGroups' );
|
|
$r = new ReflectionMethod('Groups', 'getNumberGroups');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sUserUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::getAvailableUsersCriteria
|
|
* @todo Implement testgetAvailableUsersCriteria().
|
|
*/
|
|
public function testgetAvailableUsersCriteria()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('getAvailableUsersCriteria', $methods ), 'exists method getAvailableUsersCriteria' );
|
|
$r = new ReflectionMethod('Groups', 'getAvailableUsersCriteria');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sGroupUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == true);
|
|
$this->assertTrue( $params[0]->getDefaultValue() == '');
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::verifyUsertoGroup
|
|
* @todo Implement testverifyUsertoGroup().
|
|
*/
|
|
public function testverifyUsertoGroup()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('verifyUsertoGroup', $methods ), 'exists method verifyUsertoGroup' );
|
|
$r = new ReflectionMethod('Groups', 'verifyUsertoGroup');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'GrpUid');
|
|
$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);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::verifyGroup
|
|
* @todo Implement testverifyGroup().
|
|
*/
|
|
public function testverifyGroup()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('verifyGroup', $methods ), 'exists method verifyGroup' );
|
|
$r = new ReflectionMethod('Groups', 'verifyGroup');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'sGroupUID');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
/**
|
|
* @covers Groups::load
|
|
* @todo Implement testload().
|
|
*/
|
|
public function testload()
|
|
{
|
|
$methods = get_class_methods($this->object);
|
|
$this->assertTrue( in_array('load', $methods ), 'exists method load' );
|
|
$r = new ReflectionMethod('Groups', 'load');
|
|
$params = $r->getParameters();
|
|
$this->assertTrue( $params[0]->getName() == 'GrpUid');
|
|
$this->assertTrue( $params[0]->isArray() == false);
|
|
$this->assertTrue( $params[0]->isOptional () == false);
|
|
}
|
|
|
|
}
|