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
cb8b152d
Commit
cb8b152d
authored
Mar 14, 2019
by
Bertrand Gauthier
Browse files
Début de correction des tests unitaires pour phpunit v7.
parent
fa319b5a
Changes
23
Hide whitespace changes
Inline
Side-by-side
tests/UnicaenAuthTest/Acl/NamedRoleTest.php
View file @
cb8b152d
<?php
namespace
UnicaenAuthTest\Acl
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Acl\NamedRole
;
/**
...
...
@@ -9,7 +9,7 @@ use UnicaenAuth\Acl\NamedRole;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
NamedRoleTest
extends
PHPUnit_Framework_
TestCase
class
NamedRoleTest
extends
TestCase
{
public
function
testCanConstructWithoutName
()
{
...
...
tests/UnicaenAuthTest/Authentication/Adapter/AbstractFactoryTest.php
View file @
cb8b152d
<?php
namespace
UnicaenAuthTest\Authentication\Adapter
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Authentication\Adapter\AbstractFactory
;
use
UnicaenAuth\Service\User
;
use
Zend\EventManager\EventManager
;
...
...
@@ -13,7 +13,7 @@ use Zend\ServiceManager\ServiceManager;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
AbstractFactoryTest
extends
PHPUnit_Framework_
TestCase
class
AbstractFactoryTest
extends
TestCase
{
protected
$factory
;
...
...
tests/UnicaenAuthTest/Authentication/Adapter/CasTest.php
View file @
cb8b152d
...
...
@@ -2,7 +2,7 @@
namespace
UnicaenAuthTest\Authentication\Adapter
;
use
CAS_GracefullTerminationException
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenApp\Exception
;
use
UnicaenAuth\Authentication\Adapter\Cas
;
use
Zend\EventManager\EventManager
;
...
...
@@ -18,7 +18,7 @@ require_once __VENDOR_DIR__ . '/intouch/phpcas/CAS.php';
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
CasTest
extends
PHPUnit_Framework_
TestCase
class
CasTest
extends
TestCase
{
protected
$adapter
;
protected
$moduleOptions
;
...
...
tests/UnicaenAuthTest/Authentication/Adapter/DbTest.php
View file @
cb8b152d
...
...
@@ -2,7 +2,7 @@
namespace
UnicaenAuthTest\Authentication\Adapter
;
use
PDOException
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Authentication\Adapter\Db
;
use
UnicaenAuth\Options\ModuleOptions
;
use
Zend\Http\PhpEnvironment\Request
;
...
...
@@ -15,7 +15,7 @@ use ZfcUser\Authentication\Adapter\AdapterChainEvent;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
DbTest
extends
PHPUnit_Framework_
TestCase
class
DbTest
extends
TestCase
{
protected
$adapter
;
protected
$moduleOptions
;
...
...
tests/UnicaenAuthTest/Authentication/Adapter/LdapTest.php
View file @
cb8b152d
<?php
namespace
UnicaenAuthTest\Authentication\Adapter
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Authentication\Adapter\Ldap
;
use
Zend\Authentication\Result
;
use
Zend\EventManager\EventManager
;
...
...
@@ -14,7 +14,7 @@ use ZfcUser\Authentication\Adapter\AdapterChainEvent;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
LdapTest
extends
PHPUnit_Framework_
TestCase
class
LdapTest
extends
TestCase
{
protected
$adapter
;
protected
$appModuleOptions
;
...
...
tests/UnicaenAuthTest/Authentication/Storage/ChainEventTest.php
View file @
cb8b152d
...
...
@@ -2,7 +2,7 @@
namespace
UnicaenAuthTest\Authentication\Storage
;
use
PDOException
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Authentication\Storage\Db
;
use
Zend\ServiceManager\Exception\ServiceNotFoundException
;
use
ZfcUser\Entity\User
;
...
...
@@ -13,7 +13,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ChainEventTest
extends
PHPUnit_Framework_
TestCase
class
ChainEventTest
extends
TestCase
{
protected
$event
;
...
...
tests/UnicaenAuthTest/Authentication/Storage/ChainServiceFactoryTest.php
View file @
cb8b152d
...
...
@@ -9,7 +9,7 @@ use UnicaenAuth\Authentication\Storage\ChainServiceFactory;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ChainServiceFactoryTest
extends
\
PHPUnit
_
Framework
_
TestCase
class
ChainServiceFactoryTest
extends
\
PHPUnit
\
Framework
\
TestCase
{
protected
$serviceLocator
;
protected
$eventManager
;
...
...
tests/UnicaenAuthTest/Authentication/Storage/ChainTest.php
View file @
cb8b152d
...
...
@@ -9,7 +9,7 @@ use UnicaenAuth\Authentication\Storage\Chain;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ChainTest
extends
\
PHPUnit
_
Framework
_
TestCase
class
ChainTest
extends
\
PHPUnit
\
Framework
\
TestCase
{
protected
$storage
;
protected
$innerStorage
;
...
...
tests/UnicaenAuthTest/Authentication/Storage/DbTest.php
View file @
cb8b152d
...
...
@@ -2,7 +2,7 @@
namespace
UnicaenAuthTest\Authentication\Storage
;
use
PDOException
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Authentication\Storage\Db
;
use
Zend\ServiceManager\Exception\ServiceNotFoundException
;
use
Zend\ServiceManager\ServiceManager
;
...
...
@@ -14,7 +14,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
DbTest
extends
PHPUnit_Framework_
TestCase
class
DbTest
extends
TestCase
{
protected
$storage
;
protected
$serviceManager
;
...
...
tests/UnicaenAuthTest/Authentication/Storage/LdapTest.php
View file @
cb8b152d
<?php
namespace
UnicaenAuthTest\Authentication\Storage
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenApp\Entity\Ldap\People
;
use
UnicaenAuth\Entity\Ldap\People
as
AuthPeople
;
use
UnicaenAppTest\Entity\Ldap\TestAsset\People
as
PeopleTestAsset
;
...
...
@@ -13,7 +13,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
LdapTest
extends
PHPUnit_Framework_
TestCase
class
LdapTest
extends
TestCase
{
protected
$storage
;
protected
$mapper
;
...
...
tests/UnicaenAuthTest/Entity/Db/RoleTest.php
View file @
cb8b152d
...
...
@@ -3,14 +3,14 @@
namespace
UnicaenAuthTest\Entity\Db
;
use
UnicaenAuth\Entity\Db\Role
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
/**
* Description of UserTest
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
RoleTest
extends
PHPUnit_Framework_
TestCase
class
RoleTest
extends
TestCase
{
protected
$role
;
...
...
tests/UnicaenAuthTest/Entity/Db/UserTest.php
View file @
cb8b152d
...
...
@@ -3,14 +3,14 @@
namespace
UnicaenAuthTest\Entity\Db
;
use
UnicaenAuth\Entity\Db\User
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
/**
* Description of UserTest
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
UserTest
extends
PHPUnit_Framework_
TestCase
class
UserTest
extends
TestCase
{
protected
$user
;
...
...
tests/UnicaenAuthTest/Entity/Ldap/PeopleTest.php
View file @
cb8b152d
...
...
@@ -10,7 +10,7 @@ use UnicaenAppTest\Entity\Ldap\TestAsset\People as PeopleTestAsset;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
PeopleTest
extends
\
PHPUnit
_
Framework
_
TestCase
class
PeopleTest
extends
\
PHPUnit
\
Framework
\
TestCase
{
protected
$entity
;
...
...
@@ -58,7 +58,7 @@ class PeopleTest extends \PHPUnit_Framework_TestCase
public
function
testGetDisplayNameReturnsString
()
{
$this
->
assertI
nternalType
(
'
string
'
,
$this
->
entity
->
getDisplayName
());
$this
->
assertIs
S
tring
(
$this
->
entity
->
getDisplayName
());
$this
->
assertNotEmpty
(
$this
->
entity
->
getDisplayName
());
}
...
...
@@ -72,7 +72,7 @@ class PeopleTest extends \PHPUnit_Framework_TestCase
public
function
testGetEmailReturnsString
()
{
$this
->
assertI
nternalType
(
'
string
'
,
$this
->
entity
->
getEmail
());
$this
->
assertIs
S
tring
(
$this
->
entity
->
getEmail
());
$this
->
assertNotEmpty
(
$this
->
entity
->
getEmail
());
}
...
...
tests/UnicaenAuthTest/Options/ModuleOptionsTest.php
View file @
cb8b152d
<?php
namespace
UnicaenAuthTest\Options
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Options\ModuleOptions
;
/**
...
...
@@ -9,7 +9,7 @@ use UnicaenAuth\Options\ModuleOptions;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ModuleOptionsTest
extends
PHPUnit_Framework_
TestCase
class
ModuleOptionsTest
extends
TestCase
{
protected
$options
;
...
...
@@ -31,10 +31,10 @@ class ModuleOptionsTest extends PHPUnit_Framework_TestCase
{
$options
=
new
ModuleOptions
();
$this
->
assertI
nternalType
(
'a
rray
'
,
$array
=
$options
->
getUsurpationAllowedUsernames
());
$this
->
assertI
sA
rray
(
$array
=
$options
->
getUsurpationAllowedUsernames
());
$this
->
assertEmpty
(
$array
);
$this
->
assertI
nternalType
(
'a
rray
'
,
$array
=
$options
->
getCas
());
$this
->
assertI
sA
rray
(
$array
=
$options
->
getCas
());
$this
->
assertEmpty
(
$array
);
$this
->
assertFalse
(
$this
->
options
->
getSaveLdapUserInDatabase
());
...
...
tests/UnicaenAuthTest/Provider/Identity/BaseServiceFactoryTest.php
View file @
cb8b152d
...
...
@@ -2,14 +2,14 @@
namespace
UnicaenAuthTest\Provider\Identity
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
/**
* Description of BaseServiceFactoryTest
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
abstract
class
BaseServiceFactoryTest
extends
PHPUnit_Framework_
TestCase
abstract
class
BaseServiceFactoryTest
extends
TestCase
{
protected
$serviceLocator
;
protected
$userService
;
...
...
tests/UnicaenAuthTest/Provider/Identity/BaseTest.php
View file @
cb8b152d
<?php
namespace
UnicaenAuthTest\Provider\Identity
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Acl\NamedRole
;
/**
...
...
@@ -9,7 +9,7 @@ use UnicaenAuth\Acl\NamedRole;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
abstract
class
BaseTest
extends
PHPUnit_Framework_
TestCase
abstract
class
BaseTest
extends
TestCase
{
protected
$providerClass
;
protected
$provider
;
...
...
tests/UnicaenAuthTest/Provider/Identity/ChainServiceFactoryTest.php
View file @
cb8b152d
...
...
@@ -2,7 +2,7 @@
namespace
UnicaenAuthTest\Provider\Identity
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Provider\Identity\ChainServiceFactory
;
/**
...
...
@@ -10,7 +10,7 @@ use UnicaenAuth\Provider\Identity\ChainServiceFactory;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ChainServiceFactoryTest
extends
PHPUnit_Framework_
TestCase
class
ChainServiceFactoryTest
extends
TestCase
{
protected
$serviceLocator
;
protected
$eventManager
;
...
...
tests/UnicaenAuthTest/Provider/Identity/ChainTest.php
View file @
cb8b152d
<?php
namespace
UnicaenAuthTest\Provider\Identity
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Provider\Identity\Chain
;
use
UnicaenAuth\Acl\NamedRole
;
...
...
@@ -10,7 +10,7 @@ use UnicaenAuth\Acl\NamedRole;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ChainTest
extends
PHPUnit_Framework_
TestCase
class
ChainTest
extends
TestCase
{
protected
$provider
;
protected
$authorize
;
...
...
tests/UnicaenAuthTest/Provider/Role/BaseServiceFactoryTest.php
View file @
cb8b152d
...
...
@@ -2,14 +2,14 @@
namespace
UnicaenAuthTest\Provider\Role
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
/**
* Description of ConfigServiceFactoryTest
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
abstract
class
BaseServiceFactoryTest
extends
PHPUnit_Framework_
TestCase
abstract
class
BaseServiceFactoryTest
extends
TestCase
{
protected
$serviceLocator
;
protected
$factoryClass
;
...
...
tests/UnicaenAuthTest/Provider/Role/ConfigTest.php
View file @
cb8b152d
<?php
namespace
UnicaenAuthTest\Provider\Role
;
use
PHPUnit
_
Framework
_
TestCase
;
use
PHPUnit
\
Framework
\
TestCase
;
use
UnicaenAuth\Provider\Role\Config
;
use
UnicaenAuth\Acl\NamedRole
;
use
UnicaenApp\Entity\Ldap\Group
;
...
...
@@ -11,7 +11,7 @@ use UnicaenApp\Entity\Ldap\Group;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class
ConfigTest
extends
PHPUnit_Framework_
TestCase
class
ConfigTest
extends
TestCase
{
protected
$mapper
;
...
...
Prev
1
2
Next
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