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
8a3ac33b
Commit
8a3ac33b
authored
Jul 05, 2013
by
Bertrand Gauthier
Browse files
Entité PeopleAdapter : tests unitaires.
parent
3d7cdb9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/UnicaenAuthTest/Entity/Ldap/PeopleAdapterTest.php
0 → 100644
View file @
8a3ac33b
<?php
namespace
UnicaenAuthTest\Entity\Ldap
;
use
UnicaenAuth\Entity\Ldap\PeopleAdapter
;
use
UnicaenAppTest\Entity\Ldap\TestAsset\People
as
PeopleTestAsset
;
/**
* Description of PeopleAdapterTest
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
PeopleAdapterTest
extends
\
PHPUnit_Framework_TestCase
{
protected
$entity
;
/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*/
protected
function
setUp
()
{
$this
->
entity
=
new
PeopleAdapter
(
PeopleTestAsset
::
$data1
,
12
);
}
public
function
testSuperClassAndInterface
()
{
$this
->
assertInstanceOf
(
'UnicaenApp\Entity\Ldap\People'
,
$this
->
entity
);
$this
->
assertInstanceOf
(
'ZfcUser\Entity\UserInterface'
,
$this
->
entity
);
}
public
function
testConstrutorSetsSpecifiedUserId
()
{
$this
->
assertEquals
(
$id
,
$this
->
entity
->
getId
());
}
public
function
testConstrutorReturnsLdapUidAsDefaultUserId
()
{
$entity
=
new
PeopleAdapter
(
PeopleTestAsset
::
$data1
);
$this
->
assertEquals
(
PeopleTestAsset
::
$data1
[
'uid'
],
$entity
->
getId
());
}
public
function
testStateDependsOnDeactivatedLdapBranch
()
{
$this
->
assertEquals
(
1
,
$this
->
entity
->
getState
());
$entity
=
new
PeopleAdapter
(
PeopleTestAsset
::
$dataDeactivated
,
12
);
$this
->
assertEquals
(
0
,
$entity
->
getState
());
}
public
function
testGetUsernameReturnsSupannAliasLogin
()
{
$this
->
assertEquals
(
PeopleTestAsset
::
$data1
[
'supannaliaslogin'
],
$this
->
entity
->
getUsername
());
}
public
function
testGetPasswordReturnsNull
()
{
$entity
=
new
PeopleAdapter
(
PeopleTestAsset
::
$data1
);
$this
->
assertNull
(
$entity
->
getPassword
());
}
}
\ 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