Skip to content

Commit

Permalink
Tests pour getUserId
Browse files Browse the repository at this point in the history
  • Loading branch information
feuloren committed Jul 21, 2013
1 parent ee50b64 commit e5d5f5f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
21 changes: 21 additions & 0 deletions tests/Payutc/Service/ServiceBaseRodbTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ public function loginApp(&$cookie='', &$r, $key='my_app')
return $r;
}

public function getUserId(&$cookie='', &$r, $login='trecouvr')
{
$r = httpSend('ADMINRIGHT', 'getUserId', $cookie, array(
'login' => $login,
));
return $r;
}

/**
* @requires PHP 5.4
*/
Expand Down Expand Up @@ -74,5 +82,18 @@ public function testLoginApp()
$this->loginApp($cookie, $r, 'my_app');
$this->assertEquals(200, $r->code);
}

/**
* @requires PHP 5.4
*/
public function testGetUserId()
{
$cookie = '';
$r = null;
$this->loginApp($cookie, null, 'my_app');
$this->loginCas($cookie);
$this->getUserId($cookie, $r, 'trecouvr');
$this->assertEquals(1, $r);
}
}

5 changes: 4 additions & 1 deletion tests/seed/applicationright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ tj_app_fun_afu:
app_id: 1
fun_id: 1
afu_service: POSS3

-
app_id: 1
fun_id: 1
afu_service: ADMINRIGHT
5 changes: 4 additions & 1 deletion tests/seed/fundationrights.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@ tj_usr_fun_ufu:
usr_id: 1
fun_id: 1
ufu_service: POSS3

-
user_id: 1

This comment has been minimized.

Copy link
@apuyou

apuyou Aug 13, 2013

Member

C'est usr_id

fun_id: 1
ufu_service: ADMINRIGHT

0 comments on commit e5d5f5f

Please sign in to comment.