Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lib
unicaen
auth
Commits
56355cbe
Commit
56355cbe
authored
Jul 08, 2013
by
Bertrand Gauthier
Browse files
Fournisseur de rôles nommés à partir d'un tableau : tests unitaires.
parent
9d3f3c3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/UnicaenAuthTest/Provider/Role/ConfigTest.php
0 → 100644
View file @
56355cbe
<?php
namespace
UnicaenAuthTest\Provider\Role
;
use
PHPUnit_Framework_TestCase
;
use
UnicaenAuth\Provider\Role\Config
;
/**
* Description of ConfigTest
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ConfigTest
extends
PHPUnit_Framework_TestCase
{
protected
$config
;
protected
$options
=
array
(
'guest'
=>
array
(
'name'
=>
"Profil standard"
,
'children'
=>
array
(
'cn=support_info,ou=groups,dc=unicaen,dc=fr'
,
// pas de nom pour celui-là
'cn=dsi-infra,ou=groups,dc=unicaen,dc=fr'
=>
array
(
'name'
=>
"DSI Infrastructure"
,
),
),
),
);
protected
function
setUp
()
{
$this
->
config
=
new
Config
(
$this
->
options
);
}
public
function
testLoadRolesFormConfigCreateNamedRoles
()
{
$roles
=
$this
->
config
->
getRoles
();
$expected
=
array
(
$guest
=
new
\
UnicaenAuth\Acl\NamedRole
(
'guest'
,
null
,
"Profil standard"
),
new
\
UnicaenAuth\Acl\NamedRole
(
'cn=support_info,ou=groups,dc=unicaen,dc=fr'
,
$guest
,
"cn=support_info,ou=groups,dc=unicaen,dc=fr"
),
// le nom par défaut est l'id
new
\
UnicaenAuth\Acl\NamedRole
(
'cn=dsi-infra,ou=groups,dc=unicaen,dc=fr'
,
$guest
,
"DSI Infrastructure"
),
);
$this
->
assertEquals
(
$expected
,
$roles
);
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment