Commit cb8b152d authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Début de correction des tests unitaires pour phpunit v7.

parent fa319b5a
<?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()
{
......
<?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;
......
......@@ -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;
......
......@@ -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;
......
<?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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
<?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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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->assertInternalType('string', $this->entity->getDisplayName());
$this->assertIsString($this->entity->getDisplayName());
$this->assertNotEmpty($this->entity->getDisplayName());
}
......@@ -72,7 +72,7 @@ class PeopleTest extends \PHPUnit_Framework_TestCase
public function testGetEmailReturnsString()
{
$this->assertInternalType('string', $this->entity->getEmail());
$this->assertIsString($this->entity->getEmail());
$this->assertNotEmpty($this->entity->getEmail());
}
......
<?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->assertInternalType('array', $array = $options->getUsurpationAllowedUsernames());
$this->assertIsArray($array = $options->getUsurpationAllowedUsernames());
$this->assertEmpty($array);
$this->assertInternalType('array', $array = $options->getCas());
$this->assertIsArray($array = $options->getCas());
$this->assertEmpty($array);
$this->assertFalse($this->options->getSaveLdapUserInDatabase());
......
......@@ -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;
......
<?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;
......
......@@ -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;
......
<?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;
......
......@@ -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;
......
<?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;
......
......@@ -2,7 +2,7 @@
namespace UnicaenAuthTest\Provider\Role;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use UnicaenAuth\Provider\Role\DbRole;
use BjyAuthorize\Provider\Role\ObjectRepositoryProvider;
......@@ -11,7 +11,7 @@ use BjyAuthorize\Provider\Role\ObjectRepositoryProvider;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class DbTest extends PHPUnit_Framework_TestCase
class DbTest extends TestCase
{
protected $provider;
protected $objectRepository;
......
<?php
namespace UnicaenAuthTest\Service;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use UnicaenApp\Entity\Ldap\People as LdapPeopleEntity;
use UnicaenAppTest\Entity\Ldap\TestAsset\People as LdapPeopleTestAsset;
use UnicaenAuth\Service\User;
......@@ -12,7 +12,7 @@ use ZfcUser\Authentication\Adapter\AdapterChainEvent;
*
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class UserTest extends PHPUnit_Framework_TestCase
class UserTest extends TestCase
{
protected $service;
protected $authModuleOptions;
......
<?php
namespace UnicaenAuthTest\View\Helper;
use PHPUnit_Framework_TestCase;
use PHPUnit\Framework\TestCase;
use UnicaenAuth\View\Helper\UserAbstract;
/**
......@@ -10,7 +10,7 @@ use UnicaenAuth\View\Helper\UserAbstract;
* @property UserAbstract $helper Description
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/
class UserAbstractTest extends PHPUnit_Framework_TestCase
class UserAbstractTest extends TestCase
{
protected $helper;
protected $authService;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment