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
ab9310fb
Commit
ab9310fb
authored
Jul 08, 2013
by
Bertrand Gauthier
Browse files
Classe des options du module : tests unitaires.
parent
f5c873f6
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/UnicaenAuthTest/Options/ModuleOptionsTest.php
0 → 100644
View file @
ab9310fb
<?php
namespace
UnicaenAuthTest\Options
;
use
PHPUnit_Framework_TestCase
;
use
UnicaenAuth\Options\ModuleOptions
;
/**
* Description of ModuleOptionsTest
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ModuleOptionsTest
extends
PHPUnit_Framework_TestCase
{
protected
$options
;
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*/
protected
function
setUp
()
{
$this
->
options
=
new
ModuleOptions
();
}
public
function
testSuperClass
()
{
$this
->
assertInstanceOf
(
'ZfcUser\Options\ModuleOptions'
,
$this
->
options
);
}
public
function
testOptionsDefaultValues
()
{
$options
=
new
ModuleOptions
();
$this
->
assertInternalType
(
'array'
,
$array
=
$options
->
getUsurpationAllowedUsernames
());
$this
->
assertEmpty
(
$array
);
$this
->
assertInternalType
(
'array'
,
$array
=
$options
->
getCas
());
$this
->
assertEmpty
(
$array
);
$this
->
assertFalse
(
$this
->
options
->
getSaveLdapUserInDatabase
());
}
public
function
testConstructorSetsOptions
()
{
$options
=
array
(
'usurpation_allowed_usernames'
=>
array
(
'bob'
),
'save_ldap_user_in_database'
=>
true
,
'cas'
=>
array
(
'Cas config'
),
);
$moduleOptions
=
new
ModuleOptions
(
$options
);
$this
->
assertEquals
(
array_shift
(
$options
),
$moduleOptions
->
getUsurpationAllowedUsernames
());
$this
->
assertEquals
(
array_shift
(
$options
),
$moduleOptions
->
getSaveLdapUserInDatabase
());
$this
->
assertEquals
(
array_shift
(
$options
),
$moduleOptions
->
getCas
());
}
}
\ 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