コード例 #1
0
$aDepartments = file_get_departments('departments.txt');
$iGroups = count($aGroups);
$iFirstname = count($aFirstname);
$iLastname = count($aLastname);
$iDepartments = count($aDepartments);
global $sessionId;
global $client;
global $roleOperator;
$t = new lime_test(570, new lime_output_color());
$t = new lime_test(7 + $iGroups * 2 + $iFirstname * 5 + $iDepartments * 2, new lime_output_color());
$t->diag('Reports To Test');
$t->is(function_exists('ws_open'), true, 'include wsClient.php');
$t->diag('WS WSDL URL ' . WS_WSDL_URL);
$t->diag('WS_USER_ID ' . WS_USER_ID);
$t->diag('WS_USER_PASS ' . WS_USER_PASS);
ws_open();
$t->isa_ok($client, 'SoapClient', 'class SoapClient created');
//checking the groupList
$groups = ws_groupList();
$t->is(count($groups->groups) >= 0, true, 'ws_groupList works fine');
$groupId = array();
foreach ($aGroups as $key => $val) {
    $groupId[] = group_exists($t, $groups, $val);
}
//checking roles
$roles = ws_roleList();
$t->is(count($roles->roles) >= 2, true, 'ws_roleList works fine');
$roleOperator = '';
foreach ($roles->roles as $key => $val) {
    if ($val->name == 'PROCESSMAKER_OPERATOR') {
        $roleOperator = $val->guid;
コード例 #2
0
$t->is($result->routing->delThread, 1, "delThread = 1");
$t->is($result->routing->delThreadStatus, 'OPEN', "delThreadStatus = OPEN");
$msg = trim(sprintf("Case Routed to: %s", $result->message));
$t->diag($msg);
//getCaseInfo to get the current user
$delIndex = 2;
$res = ws_getCaseInfo($caseId, $delIndex);
$t->is($res->status_code, 0, 'ws_getCaseInfo status_code = 0');
$routedUser = $res->currentUsers->userId;
$routedUserName = $res->currentUsers->userName;
$delIndex = $res->currentUsers->delIndex;
$t->diag('ws_getCaseInfo Routed user is ' . $routedUser);
$t->diag('ws_getCaseInfo Routed user is ' . $routedUserName);
$t->is($res->caseStatus, 'TO_DO', 'ws_getCaseInfo caseStatus = ' . $res->caseStatus);
//reassign this case to Mary
$res = ws_open();
$result = ws_reassignCase($caseId, $delIndex, $routedUser, $user2Uid);
$t->isa_ok($result, 'stdClass', 'executed ws_reassignCase');
if ($result->status_code == 0) {
    $t->is($result->status_code, 0, 'ws_reassignCase status_code = 0');
    $t->diag('ws_reassignCase message: ' . $result->message);
} else {
    $t->is($result->status_code, 30, 'ws_reassignCase status_code = 30');
    $t->diag('ws_reassignCase message: ' . $result->message);
}
//update delIndex after reassign
$res = ws_getCaseInfo($caseId, $delIndex);
$t->is($res->status_code, 0, 'ws_getCaseInfo status_code = 0');
$routedUser = $res->currentUsers->userId;
$routedUserName = $res->currentUsers->userName;
$delIndex = $res->currentUsers->delIndex;