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 <?php
namespace UnicaenAuthTest\Acl; namespace UnicaenAuthTest\Acl;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Acl\NamedRole; use UnicaenAuth\Acl\NamedRole;
/** /**
...@@ -9,7 +9,7 @@ use UnicaenAuth\Acl\NamedRole; ...@@ -9,7 +9,7 @@ use UnicaenAuth\Acl\NamedRole;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class NamedRoleTest extends PHPUnit_Framework_TestCase class NamedRoleTest extends TestCase
{ {
public function testCanConstructWithoutName() public function testCanConstructWithoutName()
{ {
......
<?php <?php
namespace UnicaenAuthTest\Authentication\Adapter; namespace UnicaenAuthTest\Authentication\Adapter;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Authentication\Adapter\AbstractFactory; use UnicaenAuth\Authentication\Adapter\AbstractFactory;
use UnicaenAuth\Service\User; use UnicaenAuth\Service\User;
use Zend\EventManager\EventManager; use Zend\EventManager\EventManager;
...@@ -13,7 +13,7 @@ use Zend\ServiceManager\ServiceManager; ...@@ -13,7 +13,7 @@ use Zend\ServiceManager\ServiceManager;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class AbstractFactoryTest extends PHPUnit_Framework_TestCase class AbstractFactoryTest extends TestCase
{ {
protected $factory; protected $factory;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace UnicaenAuthTest\Authentication\Adapter; namespace UnicaenAuthTest\Authentication\Adapter;
use CAS_GracefullTerminationException; use CAS_GracefullTerminationException;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenApp\Exception; use UnicaenApp\Exception;
use UnicaenAuth\Authentication\Adapter\Cas; use UnicaenAuth\Authentication\Adapter\Cas;
use Zend\EventManager\EventManager; use Zend\EventManager\EventManager;
...@@ -18,7 +18,7 @@ require_once __VENDOR_DIR__ . '/intouch/phpcas/CAS.php'; ...@@ -18,7 +18,7 @@ require_once __VENDOR_DIR__ . '/intouch/phpcas/CAS.php';
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class CasTest extends PHPUnit_Framework_TestCase class CasTest extends TestCase
{ {
protected $adapter; protected $adapter;
protected $moduleOptions; protected $moduleOptions;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace UnicaenAuthTest\Authentication\Adapter; namespace UnicaenAuthTest\Authentication\Adapter;
use PDOException; use PDOException;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Authentication\Adapter\Db; use UnicaenAuth\Authentication\Adapter\Db;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
use Zend\Http\PhpEnvironment\Request; use Zend\Http\PhpEnvironment\Request;
...@@ -15,7 +15,7 @@ use ZfcUser\Authentication\Adapter\AdapterChainEvent; ...@@ -15,7 +15,7 @@ use ZfcUser\Authentication\Adapter\AdapterChainEvent;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class DbTest extends PHPUnit_Framework_TestCase class DbTest extends TestCase
{ {
protected $adapter; protected $adapter;
protected $moduleOptions; protected $moduleOptions;
......
<?php <?php
namespace UnicaenAuthTest\Authentication\Adapter; namespace UnicaenAuthTest\Authentication\Adapter;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Authentication\Adapter\Ldap; use UnicaenAuth\Authentication\Adapter\Ldap;
use Zend\Authentication\Result; use Zend\Authentication\Result;
use Zend\EventManager\EventManager; use Zend\EventManager\EventManager;
...@@ -14,7 +14,7 @@ use ZfcUser\Authentication\Adapter\AdapterChainEvent; ...@@ -14,7 +14,7 @@ use ZfcUser\Authentication\Adapter\AdapterChainEvent;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class LdapTest extends PHPUnit_Framework_TestCase class LdapTest extends TestCase
{ {
protected $adapter; protected $adapter;
protected $appModuleOptions; protected $appModuleOptions;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace UnicaenAuthTest\Authentication\Storage; namespace UnicaenAuthTest\Authentication\Storage;
use PDOException; use PDOException;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Authentication\Storage\Db; use UnicaenAuth\Authentication\Storage\Db;
use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\ServiceManager\Exception\ServiceNotFoundException;
use ZfcUser\Entity\User; use ZfcUser\Entity\User;
...@@ -13,7 +13,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent; ...@@ -13,7 +13,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class ChainEventTest extends PHPUnit_Framework_TestCase class ChainEventTest extends TestCase
{ {
protected $event; protected $event;
......
...@@ -9,7 +9,7 @@ use UnicaenAuth\Authentication\Storage\ChainServiceFactory; ...@@ -9,7 +9,7 @@ use UnicaenAuth\Authentication\Storage\ChainServiceFactory;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class ChainServiceFactoryTest extends \PHPUnit_Framework_TestCase class ChainServiceFactoryTest extends \PHPUnit\Framework\TestCase
{ {
protected $serviceLocator; protected $serviceLocator;
protected $eventManager; protected $eventManager;
......
...@@ -9,7 +9,7 @@ use UnicaenAuth\Authentication\Storage\Chain; ...@@ -9,7 +9,7 @@ use UnicaenAuth\Authentication\Storage\Chain;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class ChainTest extends \PHPUnit_Framework_TestCase class ChainTest extends \PHPUnit\Framework\TestCase
{ {
protected $storage; protected $storage;
protected $innerStorage; protected $innerStorage;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace UnicaenAuthTest\Authentication\Storage; namespace UnicaenAuthTest\Authentication\Storage;
use PDOException; use PDOException;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Authentication\Storage\Db; use UnicaenAuth\Authentication\Storage\Db;
use Zend\ServiceManager\Exception\ServiceNotFoundException; use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ServiceManager\ServiceManager; use Zend\ServiceManager\ServiceManager;
...@@ -14,7 +14,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent; ...@@ -14,7 +14,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class DbTest extends PHPUnit_Framework_TestCase class DbTest extends TestCase
{ {
protected $storage; protected $storage;
protected $serviceManager; protected $serviceManager;
......
<?php <?php
namespace UnicaenAuthTest\Authentication\Storage; namespace UnicaenAuthTest\Authentication\Storage;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenApp\Entity\Ldap\People; use UnicaenApp\Entity\Ldap\People;
use UnicaenAuth\Entity\Ldap\People as AuthPeople; use UnicaenAuth\Entity\Ldap\People as AuthPeople;
use UnicaenAppTest\Entity\Ldap\TestAsset\People as PeopleTestAsset; use UnicaenAppTest\Entity\Ldap\TestAsset\People as PeopleTestAsset;
...@@ -13,7 +13,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent; ...@@ -13,7 +13,7 @@ use UnicaenAuth\Authentication\Storage\ChainEvent;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class LdapTest extends PHPUnit_Framework_TestCase class LdapTest extends TestCase
{ {
protected $storage; protected $storage;
protected $mapper; protected $mapper;
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
namespace UnicaenAuthTest\Entity\Db; namespace UnicaenAuthTest\Entity\Db;
use UnicaenAuth\Entity\Db\Role; use UnicaenAuth\Entity\Db\Role;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
/** /**
* Description of UserTest * Description of UserTest
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class RoleTest extends PHPUnit_Framework_TestCase class RoleTest extends TestCase
{ {
protected $role; protected $role;
......
...@@ -3,14 +3,14 @@ ...@@ -3,14 +3,14 @@
namespace UnicaenAuthTest\Entity\Db; namespace UnicaenAuthTest\Entity\Db;
use UnicaenAuth\Entity\Db\User; use UnicaenAuth\Entity\Db\User;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
/** /**
* Description of UserTest * Description of UserTest
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class UserTest extends PHPUnit_Framework_TestCase class UserTest extends TestCase
{ {
protected $user; protected $user;
......
...@@ -10,7 +10,7 @@ use UnicaenAppTest\Entity\Ldap\TestAsset\People as PeopleTestAsset; ...@@ -10,7 +10,7 @@ use UnicaenAppTest\Entity\Ldap\TestAsset\People as PeopleTestAsset;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class PeopleTest extends \PHPUnit_Framework_TestCase class PeopleTest extends \PHPUnit\Framework\TestCase
{ {
protected $entity; protected $entity;
...@@ -58,7 +58,7 @@ class PeopleTest extends \PHPUnit_Framework_TestCase ...@@ -58,7 +58,7 @@ class PeopleTest extends \PHPUnit_Framework_TestCase
public function testGetDisplayNameReturnsString() public function testGetDisplayNameReturnsString()
{ {
$this->assertInternalType('string', $this->entity->getDisplayName()); $this->assertIsString($this->entity->getDisplayName());
$this->assertNotEmpty($this->entity->getDisplayName()); $this->assertNotEmpty($this->entity->getDisplayName());
} }
...@@ -72,7 +72,7 @@ class PeopleTest extends \PHPUnit_Framework_TestCase ...@@ -72,7 +72,7 @@ class PeopleTest extends \PHPUnit_Framework_TestCase
public function testGetEmailReturnsString() public function testGetEmailReturnsString()
{ {
$this->assertInternalType('string', $this->entity->getEmail()); $this->assertIsString($this->entity->getEmail());
$this->assertNotEmpty($this->entity->getEmail()); $this->assertNotEmpty($this->entity->getEmail());
} }
......
<?php <?php
namespace UnicaenAuthTest\Options; namespace UnicaenAuthTest\Options;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Options\ModuleOptions; use UnicaenAuth\Options\ModuleOptions;
/** /**
...@@ -9,7 +9,7 @@ use UnicaenAuth\Options\ModuleOptions; ...@@ -9,7 +9,7 @@ use UnicaenAuth\Options\ModuleOptions;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class ModuleOptionsTest extends PHPUnit_Framework_TestCase class ModuleOptionsTest extends TestCase
{ {
protected $options; protected $options;
...@@ -31,10 +31,10 @@ class ModuleOptionsTest extends PHPUnit_Framework_TestCase ...@@ -31,10 +31,10 @@ class ModuleOptionsTest extends PHPUnit_Framework_TestCase
{ {
$options = new ModuleOptions(); $options = new ModuleOptions();
$this->assertInternalType('array', $array = $options->getUsurpationAllowedUsernames()); $this->assertIsArray($array = $options->getUsurpationAllowedUsernames());
$this->assertEmpty($array); $this->assertEmpty($array);
$this->assertInternalType('array', $array = $options->getCas()); $this->assertIsArray($array = $options->getCas());
$this->assertEmpty($array); $this->assertEmpty($array);
$this->assertFalse($this->options->getSaveLdapUserInDatabase()); $this->assertFalse($this->options->getSaveLdapUserInDatabase());
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
namespace UnicaenAuthTest\Provider\Identity; namespace UnicaenAuthTest\Provider\Identity;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
/** /**
* Description of BaseServiceFactoryTest * Description of BaseServiceFactoryTest
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
abstract class BaseServiceFactoryTest extends PHPUnit_Framework_TestCase abstract class BaseServiceFactoryTest extends TestCase
{ {
protected $serviceLocator; protected $serviceLocator;
protected $userService; protected $userService;
......
<?php <?php
namespace UnicaenAuthTest\Provider\Identity; namespace UnicaenAuthTest\Provider\Identity;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Acl\NamedRole; use UnicaenAuth\Acl\NamedRole;
/** /**
...@@ -9,7 +9,7 @@ use UnicaenAuth\Acl\NamedRole; ...@@ -9,7 +9,7 @@ use UnicaenAuth\Acl\NamedRole;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
abstract class BaseTest extends PHPUnit_Framework_TestCase abstract class BaseTest extends TestCase
{ {
protected $providerClass; protected $providerClass;
protected $provider; protected $provider;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace UnicaenAuthTest\Provider\Identity; namespace UnicaenAuthTest\Provider\Identity;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Provider\Identity\ChainServiceFactory; use UnicaenAuth\Provider\Identity\ChainServiceFactory;
/** /**
...@@ -10,7 +10,7 @@ use UnicaenAuth\Provider\Identity\ChainServiceFactory; ...@@ -10,7 +10,7 @@ use UnicaenAuth\Provider\Identity\ChainServiceFactory;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class ChainServiceFactoryTest extends PHPUnit_Framework_TestCase class ChainServiceFactoryTest extends TestCase
{ {
protected $serviceLocator; protected $serviceLocator;
protected $eventManager; protected $eventManager;
......
<?php <?php
namespace UnicaenAuthTest\Provider\Identity; namespace UnicaenAuthTest\Provider\Identity;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Provider\Identity\Chain; use UnicaenAuth\Provider\Identity\Chain;
use UnicaenAuth\Acl\NamedRole; use UnicaenAuth\Acl\NamedRole;
...@@ -10,7 +10,7 @@ use UnicaenAuth\Acl\NamedRole; ...@@ -10,7 +10,7 @@ use UnicaenAuth\Acl\NamedRole;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class ChainTest extends PHPUnit_Framework_TestCase class ChainTest extends TestCase
{ {
protected $provider; protected $provider;
protected $authorize; protected $authorize;
......
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
namespace UnicaenAuthTest\Provider\Role; namespace UnicaenAuthTest\Provider\Role;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
/** /**
* Description of ConfigServiceFactoryTest * Description of ConfigServiceFactoryTest
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
abstract class BaseServiceFactoryTest extends PHPUnit_Framework_TestCase abstract class BaseServiceFactoryTest extends TestCase
{ {
protected $serviceLocator; protected $serviceLocator;
protected $factoryClass; protected $factoryClass;
......
<?php <?php
namespace UnicaenAuthTest\Provider\Role; namespace UnicaenAuthTest\Provider\Role;
use PHPUnit_Framework_TestCase; use PHPUnit\Framework\TestCase;
use UnicaenAuth\Provider\Role\Config; use UnicaenAuth\Provider\Role\Config;
use UnicaenAuth\Acl\NamedRole; use UnicaenAuth\Acl\NamedRole;
use UnicaenApp\Entity\Ldap\Group; use UnicaenApp\Entity\Ldap\Group;
...@@ -11,7 +11,7 @@ use UnicaenApp\Entity\Ldap\Group; ...@@ -11,7 +11,7 @@ use UnicaenApp\Entity\Ldap\Group;
* *
* @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr> * @author Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>
*/ */
class ConfigTest extends PHPUnit_Framework_TestCase class ConfigTest extends TestCase
{ {
protected $mapper; protected $mapper;
......
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