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
459ff926
Commit
459ff926
authored
Jul 10, 2013
by
Bertrand Gauthier
Browse files
Ajout tests pour meilleure couverture.
parent
7e1b0aea
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/UnicaenAuthTest/Entity/Ldap/PeopleAdapterTest.php
View file @
459ff926
...
...
@@ -48,14 +48,66 @@ class PeopleAdapterTest extends \PHPUnit_Framework_TestCase
$this
->
assertEquals
(
0
,
$entity
->
getState
());
}
/**
* @expectedException \BadMethodCallException
*/
public
function
testSettingStateThrowsException
()
{
$this
->
entity
->
setState
(
'whatever'
);
}
public
function
testGetDisplayNameReturnsString
()
{
$this
->
assertInternalType
(
'string'
,
$this
->
entity
->
getDisplayName
());
$this
->
assertNotEmpty
(
$this
->
entity
->
getDisplayName
());
}
/**
* @expectedException \BadMethodCallException
*/
public
function
testSettingDisplayNameThrowsException
()
{
$this
->
entity
->
setDisplayName
(
'whatever'
);
}
public
function
testGetEmailReturnsString
()
{
$this
->
assertInternalType
(
'string'
,
$this
->
entity
->
getEmail
());
$this
->
assertNotEmpty
(
$this
->
entity
->
getEmail
());
}
/**
* @expectedException \BadMethodCallException
*/
public
function
testSettingEmailThrowsException
()
{
$this
->
entity
->
setEmail
(
'whatever'
);
}
public
function
testGetUsernameReturnsSupannAliasLogin
()
{
$this
->
assertEquals
(
PeopleTestAsset
::
$data1
[
'supannaliaslogin'
],
$this
->
entity
->
getUsername
());
}
/**
* @expectedException \BadMethodCallException
*/
public
function
testSettingUsernameThrowsException
()
{
$this
->
entity
->
setUsername
(
'whatever'
);
}
public
function
testGetPasswordReturnsNull
()
{
$entity
=
new
PeopleAdapter
(
PeopleTestAsset
::
$data1
);
$this
->
assertNull
(
$entity
->
getPassword
());
}
/**
* @expectedException \BadMethodCallException
*/
public
function
testSettingPasswordThrowsException
()
{
$this
->
entity
->
setPassword
(
'whatever'
);
}
}
\ 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