Commit 0240732b authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Migration vers laminas

parent d507f84b
Pipeline #11068 passed with stage
in 25 seconds
......@@ -5,9 +5,9 @@ use PHPUnit_Framework_TestCase;
use UnicaenApp\Mapper\Ldap\People;
use UnicaenAuth\Authentication\Adapter\AbstractFactory;
use UnicaenAuth\Service\User;
use Zend\EventManager\EventManager;
use Zend\EventManager\EventManagerAwareInterface;
use Zend\ServiceManager\ServiceManager;
use Laminas\EventManager\EventManager;
use Laminas\EventManager\EventManagerAwareInterface;
use Laminas\ServiceManager\ServiceManager;
use UnicaenApp\Exception\LogicException;
use ZfcUser\Options\ModuleOptions;
......@@ -81,7 +81,7 @@ class AbstractFactoryTest extends PHPUnit_Framework_TestCase
{
$eventManager = new EventManager();
$serviceLocator = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceLocator = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceLocator->expects($this->any())
->method('get')
->will($this->returnCallback(function($serviceName) use ($eventManager) {
......
......@@ -6,11 +6,11 @@ use PHPUnit_Framework_TestCase;
use UnicaenApp\Exception\RuntimeException;
use UnicaenAuth\Authentication\Adapter\Cas;
use UnicaenAuth\Options\ModuleOptions;
use Zend\EventManager\EventManager;
use Zend\Router\Http\TreeRouteStack;
use Zend\Uri\Uri;
use Laminas\EventManager\EventManager;
use Laminas\Router\Http\TreeRouteStack;
use Laminas\Uri\Uri;
use ZfcUser\Authentication\Adapter\AdapterChainEvent;
use Zend\Authentication\Result;
use Laminas\Authentication\Result;
/**
* Description of CasTest
......@@ -51,7 +51,7 @@ class CasTest extends PHPUnit_Framework_TestCase
],
]);
$serviceManager = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceManager = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceManager->expects($this->any())
->method('get')
->will($this->returnCallback(function($serviceName) use ($moduleOptions) {
......@@ -62,8 +62,8 @@ class CasTest extends PHPUnit_Framework_TestCase
return $moduleOptions;
}
if ('router' === $serviceName) {
$router = new \Zend\Mvc\Router\Http\TreeRouteStack();
$router->setBaseUrl('/appli')->setRequestUri(new \Zend\Uri\Http('/request'));
$router = new \Laminas\Mvc\Router\Http\TreeRouteStack();
$router->setBaseUrl('/appli')->setRequestUri(new \Laminas\Uri\Http('/request'));
return $router;
}
return null;
......
......@@ -5,11 +5,11 @@ use PDOException;
use PHPUnit_Framework_TestCase;
use UnicaenAuth\Authentication\Adapter\Db;
use UnicaenAuth\Options\ModuleOptions;
use Zend\EventManager\EventInterface;
use Zend\Http\PhpEnvironment\Request;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ServiceManager\ServiceManager;
use Zend\Stdlib\Parameters;
use Laminas\EventManager\EventInterface;
use Laminas\Http\PhpEnvironment\Request;
use Laminas\ServiceManager\Exception\ServiceNotFoundException;
use Laminas\ServiceManager\ServiceManager;
use Laminas\Stdlib\Parameters;
use ZfcUser\Authentication\Adapter\AdapterChainEvent;
use ZfcUser\Mapper\User;
......@@ -57,7 +57,7 @@ class DbTest extends PHPUnit_Framework_TestCase
$this->mapper = $mapper = $this->createMock('ZfcUser\Mapper\User'/*, ['findByUsername', 'findByEmail']*/);
/** @var ServiceManager|\PHPUnit_Framework_MockObject_MockObject $serviceManager */
$serviceManager = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceManager = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceManager->expects($this->any())
->method('get')
->will($this->returnCallback(function($serviceName) use ($moduleOptions, $mapper) {
......
......@@ -5,13 +5,13 @@ namespace UnicaenAuthTest\Authentication\Adapter;
use PHPUnit_Framework_TestCase;
use UnicaenApp\Mapper\Ldap\People;
use UnicaenAuth\Authentication\Adapter\Ldap;
use Zend\Authentication\Result;
use Zend\Authentication\Storage\StorageInterface;
use Zend\EventManager\EventInterface;
use Zend\EventManager\EventManager;
use Zend\Http\Request;
use Zend\ServiceManager\ServiceManager;
use Zend\Stdlib\Parameters;
use Laminas\Authentication\Result;
use Laminas\Authentication\Storage\StorageInterface;
use Laminas\EventManager\EventInterface;
use Laminas\EventManager\EventManager;
use Laminas\Http\Request;
use Laminas\ServiceManager\ServiceManager;
use Laminas\Stdlib\Parameters;
use ZfcUser\Authentication\Adapter\AdapterChainEvent;
/**
......@@ -27,7 +27,7 @@ class LdapTest extends PHPUnit_Framework_TestCase
protected $adapter;
/**
* @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject
* @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject
*/
protected $zendAuthLdapAdapter;
......@@ -68,7 +68,7 @@ class LdapTest extends PHPUnit_Framework_TestCase
]);
/** @var ServiceManager|\PHPUnit_Framework_MockObject_MockObject $serviceManager */
$serviceManager = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceManager = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceManager->expects($this->any())
->method('get')
->will($this->returnCallback(function($serviceName) use ($authModuleOptions, $appModuleOptions) {
......@@ -94,7 +94,7 @@ class LdapTest extends PHPUnit_Framework_TestCase
$this->adapter->setAppModuleOptions($this->appModuleOptions);
$adapter = $this->adapter->getLdapAuthAdapter();
$this->assertInstanceOf('Zend\Authentication\Adapter\Ldap', $adapter);
$this->assertInstanceOf('Laminas\Authentication\Adapter\Ldap', $adapter);
$appModuleLdapOptions = $this->appModuleOptions->getLdap();
$connectionNames = array_keys($appModuleLdapOptions['connection']);
......@@ -137,17 +137,17 @@ class LdapTest extends PHPUnit_Framework_TestCase
public function testUsurpationWithAllowedUsernameAndSuccessfulAuthentication()
{
/** @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Zend\Authentication\Adapter\Ldap');
/** @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Laminas\Authentication\Adapter\Ldap');
/** @var \Zend\Ldap\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldap */
$ldap = $this->createMock(\Zend\Ldap\Ldap::class);
/** @var \Laminas\Ldap\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldap */
$ldap = $this->createMock(\Laminas\Ldap\Ldap::class);
$ldap
->expects($this->once())
->method('searchEntries')
->willReturn(true);
/** @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldapAuthAdapter */
/** @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldapAuthAdapter */
$this->zendAuthLdapAdapter->expects($this->once())
->method('getLdap')
->willReturn($ldap);
......@@ -166,17 +166,17 @@ class LdapTest extends PHPUnit_Framework_TestCase
public function testUsurpationWithAllowedUsernameAndUnsuccessfulAuthentication()
{
/** @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Zend\Authentication\Adapter\Ldap');
/** @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Laminas\Authentication\Adapter\Ldap');
/** @var \Zend\Ldap\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldap */
$ldap = $this->createMock(\Zend\Ldap\Ldap::class);
/** @var \Laminas\Ldap\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldap */
$ldap = $this->createMock(\Laminas\Ldap\Ldap::class);
$ldap
->expects($this->once())
->method('searchEntries')
->willReturn([]);
/** @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldapAuthAdapter */
/** @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldapAuthAdapter */
$this->zendAuthLdapAdapter->expects($this->once())
->method('getLdap')
->willReturn($ldap);
......@@ -196,17 +196,17 @@ class LdapTest extends PHPUnit_Framework_TestCase
public function testUsurpationWithAllowedButUnexistingUsername()
{
/** @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Zend\Authentication\Adapter\Ldap');
/** @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Laminas\Authentication\Adapter\Ldap');
/** @var \Zend\Ldap\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldap */
$ldap = $this->createMock(\Zend\Ldap\Ldap::class);
/** @var \Laminas\Ldap\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldap */
$ldap = $this->createMock(\Laminas\Ldap\Ldap::class);
$ldap
->expects($this->once())
->method('searchEntries')
->willReturn([]);
/** @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldapAuthAdapter */
/** @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $ldapAuthAdapter */
$this->zendAuthLdapAdapter->expects($this->once())
->method('getLdap')
->willReturn($ldap);
......@@ -226,8 +226,8 @@ class LdapTest extends PHPUnit_Framework_TestCase
public function testUsurpationWithNotAllowedUsernameAndSuccessfulAuthentication()
{
/** @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Zend\Authentication\Adapter\Ldap');
/** @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Laminas\Authentication\Adapter\Ldap');
$this->authModuleOptions->setUsurpationAllowedUsernames([]);
$event = new AdapterChainEvent();
......@@ -242,8 +242,8 @@ class LdapTest extends PHPUnit_Framework_TestCase
public function testUsurpationWithNotAllowedUsernameAndUnsuccessfulAuthentication()
{
/** @var \Zend\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Zend\Authentication\Adapter\Ldap');
/** @var \Laminas\Authentication\Adapter\Ldap|\PHPUnit_Framework_MockObject_MockObject $zendAuthLdapAdapter */
$this->zendAuthLdapAdapter = $this->createMock('Laminas\Authentication\Adapter\Ldap');
$this->authModuleOptions->setUsurpationAllowedUsernames([]);
$event = new AdapterChainEvent();
......
......@@ -12,7 +12,7 @@ use UnicaenAppTest\BaseServiceFactoryTest;
class ModuleOptionsFactoryTest extends BaseServiceFactoryTest
{
protected $factoryClass = 'UnicaenAuth\Authentication\AuthenticationServiceFactory';
protected $serviceClass = 'Zend\Authentication\AuthenticationService';
protected $serviceClass = 'Laminas\Authentication\AuthenticationService';
public function testCanCreateService()
{
......
......@@ -4,7 +4,7 @@ namespace UnicaenAuthTest\Authentication\Storage;
use PDOException;
use PHPUnit_Framework_TestCase;
use UnicaenAuth\Authentication\Storage\Db;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Laminas\ServiceManager\Exception\ServiceNotFoundException;
use ZfcUser\Entity\User;
use UnicaenAuth\Authentication\Storage\ChainEvent;
......
......@@ -23,7 +23,7 @@ class ChainServiceFactoryTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->factory = new ChainServiceFactory();
$this->serviceLocator = $this->createMock('Zend\ServiceManager\ServiceLocatorInterface'/*, []*/);
$this->serviceLocator = $this->createMock('Laminas\ServiceManager\ServiceLocatorInterface'/*, []*/);
$this->ldapStorage = $this->createMock('UnicaenAuth\Authentication\Storage\Ldap'/*, $this->events*/);
$this->dbStorage = $this->createMock('UnicaenAuth\Authentication\Storage\Db'/*, $this->events*/);
}
......@@ -39,7 +39,7 @@ class ChainServiceFactoryTest extends \PHPUnit_Framework_TestCase
$this->assertInstanceOf('UnicaenAuth\Authentication\Storage\Chain', $service);
foreach ($this->events as $event) {
$listeners = $service->getEventManager()->getListeners($event); /* @var $listeners \Zend\Stdlib\SplPriorityQueue */
$listeners = $service->getEventManager()->getListeners($event); /* @var $listeners \Laminas\Stdlib\SplPriorityQueue */
$this->assertCount(2, $listeners);
}
}
......
......@@ -31,8 +31,8 @@ class ChainTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->storage = new Chain();
$this->innerStorage = $this->createMock('Zend\Authentication\Storage\Session'/*, ['isEmpty', 'read', 'write', 'clear']*/);
$this->eventManager = $this->createMock('Zend\EventManager\EventManager'/*, ['trigger']*/);
$this->innerStorage = $this->createMock('Laminas\Authentication\Storage\Session'/*, ['isEmpty', 'read', 'write', 'clear']*/);
$this->eventManager = $this->createMock('Laminas\EventManager\EventManager'/*, ['trigger']*/);
$this->event = $this->createMock('UnicaenAuth\Authentication\Storage\ChainEvent'/*, ['getContents']*/);
$this->storage->setStorage($this->innerStorage)
......@@ -43,26 +43,26 @@ class ChainTest extends \PHPUnit_Framework_TestCase
public function testCanRetrieveDefaultInnerStorage()
{
$storage = new Chain();
$this->assertInstanceOf('Zend\Authentication\Storage\StorageInterface', $storage->getStorage());
$this->assertInstanceOf('Laminas\Authentication\Storage\StorageInterface', $storage->getStorage());
}
public function testCanSetInnerStorage()
{
$storage = new Chain();
$storage->setStorage($inner = new \Zend\Authentication\Storage\Session());
$storage->setStorage($inner = new \Laminas\Authentication\Storage\Session());
$this->assertSame($inner, $storage->getStorage());
}
public function testCanRetrieveDefaultEventManager()
{
$storage = new Chain();
$this->assertInstanceOf('Zend\EventManager\EventManagerInterface', $storage->getEventManager());
$this->assertInstanceOf('Laminas\EventManager\EventManagerInterface', $storage->getEventManager());
}
public function testCanSetEventManager()
{
$storage = new Chain();
$storage->setEventManager($em = new \Zend\EventManager\EventManager());
$storage->setEventManager($em = new \Laminas\EventManager\EventManager());
$this->assertSame($em, $storage->getEventManager());
}
......
......@@ -4,8 +4,8 @@ namespace UnicaenAuthTest\Authentication\Storage;
use PDOException;
use PHPUnit_Framework_TestCase;
use UnicaenAuth\Authentication\Storage\Db;
use Zend\ServiceManager\Exception\ServiceNotFoundException;
use Zend\ServiceManager\ServiceManager;
use Laminas\ServiceManager\Exception\ServiceNotFoundException;
use Laminas\ServiceManager\ServiceManager;
use ZfcUser\Entity\User;
use UnicaenAuth\Authentication\Storage\ChainEvent;
......@@ -27,8 +27,8 @@ class DbTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->serviceManager = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$this->innerStorage = $this->createMock('Zend\Authentication\Storage\Session'/*, ['write', 'clear', 'read']*/);
$this->serviceManager = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$this->innerStorage = $this->createMock('Laminas\Authentication\Storage\Session'/*, ['write', 'clear', 'read']*/);
$this->mapper = $this->createMock('ZfcUser\Mapper\User'/*, ['findById', 'findByUsername']*/);
$this->event = new ChainEvent();
$this->storage = new Db();
......@@ -41,7 +41,7 @@ class DbTest extends PHPUnit_Framework_TestCase
public function testCanRetrieveDefaultInnerStorage()
{
$storage = new Db();
$this->assertInstanceOf('Zend\Authentication\Storage\StorageInterface', $storage->getStorage());
$this->assertInstanceOf('Laminas\Authentication\Storage\StorageInterface', $storage->getStorage());
}
public function testCanRetrieveMapperFromServiceManager()
......
......@@ -30,7 +30,7 @@ class LdapTest extends PHPUnit_Framework_TestCase
protected $event;
/**
* @var \PHPUnit_Framework_MockObject_MockObject|\Zend\Authentication\Storage\Session
* @var \PHPUnit_Framework_MockObject_MockObject|\Laminas\Authentication\Storage\Session
*/
protected $innerStorage;
......@@ -41,8 +41,8 @@ class LdapTest extends PHPUnit_Framework_TestCase
protected function setUp()
{
$this->options = new \UnicaenAuth\Options\ModuleOptions();
$this->serviceManager = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$this->innerStorage = $this->createMock('Zend\Authentication\Storage\Session'/*, ['write', 'clear', 'read']*/);
$this->serviceManager = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$this->innerStorage = $this->createMock('Laminas\Authentication\Storage\Session'/*, ['write', 'clear', 'read']*/);
$this->mapper = $this->createMock('UnicaenApp\Mapper\Ldap\People'/*, ['findOneByUsername']*/);
$this->event = new ChainEvent();
$this->storage = new Ldap();
......@@ -55,7 +55,7 @@ class LdapTest extends PHPUnit_Framework_TestCase
public function testCanRetrieveDefaultInnerStorage()
{
$storage = new Ldap();
$this->assertInstanceOf('Zend\Authentication\Storage\StorageInterface', $storage->getStorage());
$this->assertInstanceOf('Laminas\Authentication\Storage\StorageInterface', $storage->getStorage());
}
public function testCanRetrieveMapperFromLdapService()
......
......@@ -3,7 +3,7 @@
namespace UnicaenAuthTest\Options;
use UnicaenAppTest\BaseServiceFactoryTest;
use Zend\Config\Config;
use Laminas\Config\Config;
/**
* Description of ModuleOptionsFactoryTest
......
......@@ -24,8 +24,8 @@ abstract class BaseServiceFactoryTest extends TestCase
protected function setUp()
{
$this->factory = new $this->factoryClass();
$this->serviceLocator = $this->createMock('Zend\ServiceManager\ServiceLocatorInterface'/*, []*/);
$this->authService = $this->createMock('Zend\Authentication\AuthenticationService'/*, []*/);
$this->serviceLocator = $this->createMock('Laminas\ServiceManager\ServiceLocatorInterface'/*, []*/);
$this->authService = $this->createMock('Laminas\Authentication\AuthenticationService'/*, []*/);
$this->userService = $this->createMock('ZfcUser\Service\User'/*, ['getAuthService']*/);
}
......
......@@ -22,8 +22,8 @@ abstract class BaseTest extends TestCase
*/
protected function setUp()
{
$this->serviceManager = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$this->authService = $this->createMock('Zend\Authentication\AuthenticationService'/*, ['getIdentity']*/);
$this->serviceManager = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$this->authService = $this->createMock('Laminas\Authentication\AuthenticationService'/*, ['getIdentity']*/);
$this->provider = new $this->providerClass($this->authService);
}
......@@ -88,13 +88,13 @@ abstract class BaseTest extends TestCase
// // fournisseur des ACL
// $this->authorize->expects($this->any())
// ->method('getAcl')
// ->will($this->returnValue($acl = new \Zend\Permissions\Acl\Acl()));
// ->will($this->returnValue($acl = new \Laminas\Permissions\Acl\Acl()));
//
// $roles = $this->provider->getIdentityRoles();
// $this->assertEquals(array($this->defaultRole), $roles);
//
// // NB: le rôle par défaut n'a pas besoin d'être connu des ACL
// $this->setExpectedException('Zend\Permissions\Acl\Exception\InvalidArgumentException');
// $this->setExpectedException('Laminas\Permissions\Acl\Exception\InvalidArgumentException');
// $acl->getRole($this->defaultRole->getRoleId());
// }
//
......@@ -108,7 +108,7 @@ abstract class BaseTest extends TestCase
// $this->assertNotEmpty($identity->getMemberOf(), "Pré-requis non respecté : memberOf vide.");
//
// // fournisseur des ACL
// $acl = new \Zend\Permissions\Acl\Acl();
// $acl = new \Laminas\Permissions\Acl\Acl();
// $acl->addRole($role = new GenericRole('cn=admin_reseau,ou=groups,dc=unicaen,dc=fr'));
// $this->authorize->expects($this->any())
// ->method('getAcl')
......
......@@ -24,7 +24,7 @@ class ChainServiceFactoryTest extends TestCase
protected function setUp()
{
$this->factory = new ChainServiceFactory();
$this->serviceLocator = $this->createMock('Zend\ServiceManager\ServiceLocatorInterface'/*, []*/);
$this->serviceLocator = $this->createMock('Laminas\ServiceManager\ServiceLocatorInterface'/*, []*/);
$this->ldapProvider = $this->createMock('UnicaenAuth\Provider\Identity\Ldap'/**//*, $this->events, [], '', false*/);
$this->dbProvider = $this->createMock('UnicaenAuth\Provider\Identity\Db'/*, $this->events, [], '', false*/);
}
......@@ -40,7 +40,7 @@ class ChainServiceFactoryTest extends TestCase
$this->assertInstanceOf('UnicaenAuth\Provider\Identity\Chain', $service);
foreach ($this->events as $event) {
$listeners = $service->getEventManager()->getListeners($event); /* @var $listeners \Zend\Stdlib\SplPriorityQueue */
$listeners = $service->getEventManager()->getListeners($event); /* @var $listeners \Laminas\Stdlib\SplPriorityQueue */
$this->assertCount(2, $listeners);
}
}
......
......@@ -27,12 +27,12 @@ class ChainTest extends TestCase
protected function setUp()
{
$this->authorize = $this->createMock('BjyAuthorize\Service\Authorize'/*, ['getAcl'], [], '', false*/);
$this->serviceManager = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$this->authService = $this->createMock('Zend\Authentication\AuthenticationService'/*, ['getIdentity']*/);
$this->serviceManager = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$this->authService = $this->createMock('Laminas\Authentication\AuthenticationService'/*, ['getIdentity']*/);
$this->provider = new Chain($this->authService);
$this->eventManager = $this->createMock('Zend\EventManager\EventManager'/*, ['trigger']*/);
$this->eventManager = $this->createMock('Laminas\EventManager\EventManager'/*, ['trigger']*/);
$this->event = $this->createMock('UnicaenAuth\Provider\Identity\ChainEvent'/*, ['getRoles']*/);
$this->acl = $this->createMock('Zend\Permissions\Acl\Acl'/*, ['hasRole', 'getRole']*/);
$this->acl = $this->createMock('Laminas\Permissions\Acl\Acl'/*, ['hasRole', 'getRole']*/);
$this->authorize->expects($this->any())
->method('getAcl')
......@@ -50,7 +50,7 @@ class ChainTest extends TestCase
public function testCanRetrieveDefaultEventManager()
{
$provider = new Chain($this->authService);
$this->assertInstanceOf('Zend\EventManager\EventManager', $provider->getEventManager());
$this->assertInstanceOf('Laminas\EventManager\EventManager', $provider->getEventManager());
}
public function testCanRetrieveDefaultEvent()
......
......@@ -23,6 +23,6 @@ abstract class BaseServiceFactoryTest extends TestCase
protected function setUp()
{
$this->factory = new $this->factoryClass();
$this->serviceLocator = $this->createMock('Zend\ServiceManager\ServiceLocatorInterface'/*, []*/);
$this->serviceLocator = $this->createMock('Laminas\ServiceManager\ServiceLocatorInterface'/*, []*/);
}
}
\ No newline at end of file
......@@ -35,7 +35,7 @@ class UserTest extends PHPUnit_Framework_TestCase
$this->mapper = $mapper = $this->createMock('UnicaenApp\Mapper\Ldap\People'/*, ['findOneByUsername']*/);
$serviceManager = $this->createMock('Zend\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceManager = $this->createMock('Laminas\ServiceManager\ServiceManager'/*, ['get']*/);
$serviceManager->expects($this->any())
->method('get')
->will($this->returnCallback(function($serviceName) use ($authModuleOptions, $zfcMapper, $mapper) {
......
......@@ -25,7 +25,7 @@ class AppConnectionTest extends AbstractTest
{
parent::setUp();
$this->renderer = $this->createMock('Zend\View\Renderer\PhpRenderer'/*, ['plugin']*/);
$this->renderer = $this->createMock('Laminas\View\Renderer\PhpRenderer'/*, ['plugin']*/);
$this->helper->setView($this->renderer);
}
......
......@@ -21,7 +21,7 @@ class UserAbstractTest extends PHPUnit_Framework_TestCase
*/
protected function setUp()
{
$this->authService = $this->createMock('Zend\Authentication\AuthenticationService'/*, ['hasIdentity', 'getIdentity']*/);
$this->authService = $this->createMock('Laminas\Authentication\AuthenticationService'/*, ['hasIdentity', 'getIdentity']*/);
$this->helper = $this->getMockForAbstractClass('UnicaenAuth\View\Helper\UserAbstract');
$this->helper->setAuthService($this->authService);
......
......@@ -16,7 +16,7 @@ class UserConnectionFactoryTest extends BaseServiceFactoryTest
public function testCanCreateService()
{
$authService = $this->createMock('Zend\Authentication\AuthenticationService');
$authService = $this->createMock('Laminas\Authentication\AuthenticationService');
$this->serviceManager->expects($this->once())
->method('get')
......
Supports Markdown
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