Skip to content
Snippets Groups Projects
Commit e699144c authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

laminas-migration migrate

parent 4c578763
Branches
Tags
No related merge requests found
Pipeline #10459 passed
Showing
with 102 additions and 102 deletions
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace ZfcUser\Form; namespace ZfcUser\Form;
use Zend\Form\Element\Captcha as Captcha; use Laminas\Form\Element\Captcha as Captcha;
use ZfcUser\Options\RegistrationOptionsInterface; use ZfcUser\Options\RegistrationOptionsInterface;
class Register extends Base class Register extends Base
...@@ -27,7 +27,7 @@ class Register extends Base ...@@ -27,7 +27,7 @@ class Register extends Base
if ($this->getRegistrationOptions()->getUseRegistrationFormCaptcha()) { if ($this->getRegistrationOptions()->getUseRegistrationFormCaptcha()) {
$this->add(array( $this->add(array(
'name' => 'captcha', 'name' => 'captcha',
'type' => 'Zend\Form\Element\Captcha', 'type' => 'Laminas\Form\Element\Captcha',
'options' => array( 'options' => array(
'label' => 'Please type the following text', 'label' => 'Please type the following text',
'captcha' => $this->getRegistrationOptions()->getFormCaptchaOptions(), 'captcha' => $this->getRegistrationOptions()->getFormCaptchaOptions(),
......
<?php <?php
namespace ZfcUser\InputFilter; namespace ZfcUser\InputFilter;
use Zend\EventManager\EventManagerAwareTrait; use Laminas\EventManager\EventManagerAwareTrait;
use Zend\InputFilter\InputFilter; use Laminas\InputFilter\InputFilter;
class ProvidesEventsInputFilter extends InputFilter class ProvidesEventsInputFilter extends InputFilter
{ {
......
<?php <?php
namespace ZfcUser\Mapper; namespace ZfcUser\Mapper;
use Zend\Db\Adapter\Adapter; use Laminas\Db\Adapter\Adapter;
use Zend\Db\Adapter\Driver\ResultInterface; use Laminas\Db\Adapter\Driver\ResultInterface;
use Zend\Db\ResultSet\HydratingResultSet; use Laminas\Db\ResultSet\HydratingResultSet;
use Zend\Db\Sql\Select; use Laminas\Db\Sql\Select;
use Zend\Db\Sql\Sql; use Laminas\Db\Sql\Sql;
use Zend\Db\Sql\TableIdentifier; use Laminas\Db\Sql\TableIdentifier;
use Zend\Hydrator\HydratorInterface; use Laminas\Hydrator\HydratorInterface;
use Zend\Hydrator\ClassMethods; use Laminas\Hydrator\ClassMethods;
use ZfcUser\Entity\UserInterface as UserEntityInterface; use ZfcUser\Entity\UserInterface as UserEntityInterface;
use ZfcUser\EventManager\EventProvider; use ZfcUser\EventManager\EventProvider;
use ZfcUser\Db\Adapter\MasterSlaveAdapterInterface; use ZfcUser\Db\Adapter\MasterSlaveAdapterInterface;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
namespace ZfcUser\Mapper; namespace ZfcUser\Mapper;
use ZfcUser\Entity\UserInterface as UserEntityInterface; use ZfcUser\Entity\UserInterface as UserEntityInterface;
use Zend\Hydrator\HydratorInterface; use Laminas\Hydrator\HydratorInterface;
class User extends AbstractDbMapper implements UserInterface class User extends AbstractDbMapper implements UserInterface
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace ZfcUser\Mapper; namespace ZfcUser\Mapper;
use Zend\Hydrator\ClassMethods; use Laminas\Hydrator\ClassMethods;
use ZfcUser\Entity\UserInterface as UserEntityInterface; use ZfcUser\Entity\UserInterface as UserEntityInterface;
class UserHydrator extends ClassMethods class UserHydrator extends ClassMethods
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace ZfcUser\Options; namespace ZfcUser\Options;
use Zend\Stdlib\AbstractOptions; use Laminas\Stdlib\AbstractOptions;
class ModuleOptions extends AbstractOptions implements class ModuleOptions extends AbstractOptions implements
UserControllerOptionsInterface, UserControllerOptionsInterface,
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
namespace ZfcUser\Service; namespace ZfcUser\Service;
use Interop\Container\ContainerInterface; use Interop\Container\ContainerInterface;
use Zend\Authentication\AuthenticationService; use Laminas\Authentication\AuthenticationService;
use Zend\Form\Form; use Laminas\Form\Form;
use Zend\ServiceManager\ServiceManager; use Laminas\ServiceManager\ServiceManager;
use Zend\Crypt\Password\Bcrypt; use Laminas\Crypt\Password\Bcrypt;
use Zend\Hydrator; use Laminas\Hydrator;
use ZfcUser\EventManager\EventProvider; use ZfcUser\EventManager\EventProvider;
use ZfcUser\Mapper\UserInterface as UserMapperInterface; use ZfcUser\Mapper\UserInterface as UserMapperInterface;
use ZfcUser\Options\UserServiceOptionsInterface; use ZfcUser\Options\UserServiceOptionsInterface;
...@@ -288,7 +288,7 @@ class User extends EventProvider ...@@ -288,7 +288,7 @@ class User extends EventProvider
/** /**
* Return the Form Hydrator * Return the Form Hydrator
* *
* @return \Zend\Hydrator\ClassMethods * @return \Laminas\Hydrator\ClassMethods
*/ */
public function getFormHydrator() public function getFormHydrator()
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace ZfcUser\Validator; namespace ZfcUser\Validator;
use Zend\Validator\AbstractValidator; use Laminas\Validator\AbstractValidator;
use ZfcUser\Mapper\UserInterface; use ZfcUser\Mapper\UserInterface;
abstract class AbstractRecord extends AbstractValidator abstract class AbstractRecord extends AbstractValidator
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
namespace ZfcUser\View\Helper; namespace ZfcUser\View\Helper;
use Zend\View\Helper\AbstractHelper; use Laminas\View\Helper\AbstractHelper;
use Zend\Authentication\AuthenticationService; use Laminas\Authentication\AuthenticationService;
use ZfcUser\Entity\UserInterface as User; use ZfcUser\Entity\UserInterface as User;
class ZfcUserDisplayName extends AbstractHelper class ZfcUserDisplayName extends AbstractHelper
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
namespace ZfcUser\View\Helper; namespace ZfcUser\View\Helper;
use Zend\View\Helper\AbstractHelper; use Laminas\View\Helper\AbstractHelper;
use Zend\Authentication\AuthenticationService; use Laminas\Authentication\AuthenticationService;
class ZfcUserIdentity extends AbstractHelper class ZfcUserIdentity extends AbstractHelper
{ {
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
namespace ZfcUser\View\Helper; namespace ZfcUser\View\Helper;
use Zend\View\Helper\AbstractHelper; use Laminas\View\Helper\AbstractHelper;
use ZfcUser\Form\Login as LoginForm; use ZfcUser\Form\Login as LoginForm;
use Zend\View\Model\ViewModel; use Laminas\View\Model\ViewModel;
class ZfcUserLoginWidget extends AbstractHelper class ZfcUserLoginWidget extends AbstractHelper
{ {
......
...@@ -23,7 +23,7 @@ class AbstractAdapterTest extends \PHPUnit_Framework_TestCase ...@@ -23,7 +23,7 @@ class AbstractAdapterTest extends \PHPUnit_Framework_TestCase
*/ */
public function testGetStorageWithoutStorageSet() public function testGetStorageWithoutStorageSet()
{ {
$this->assertInstanceOf('Zend\Authentication\Storage\Session', $this->adapter->getStorage()); $this->assertInstanceOf('Laminas\Authentication\Storage\Session', $this->adapter->getStorage());
} }
/** /**
...@@ -32,11 +32,11 @@ class AbstractAdapterTest extends \PHPUnit_Framework_TestCase ...@@ -32,11 +32,11 @@ class AbstractAdapterTest extends \PHPUnit_Framework_TestCase
*/ */
public function testSetGetStorage() public function testSetGetStorage()
{ {
$storage = new \Zend\Authentication\Storage\Session('ZfcUser'); $storage = new \Laminas\Authentication\Storage\Session('ZfcUser');
$storage->write('zfcUser'); $storage->write('zfcUser');
$this->adapter->setStorage($storage); $this->adapter->setStorage($storage);
$this->assertInstanceOf('Zend\Authentication\Storage\Session', $this->adapter->getStorage()); $this->assertInstanceOf('Laminas\Authentication\Storage\Session', $this->adapter->getStorage());
$this->assertSame('zfcUser', $this->adapter->getStorage()->read()); $this->assertSame('zfcUser', $this->adapter->getStorage()->read());
} }
......
...@@ -68,9 +68,9 @@ class AdapterChainEventTest extends \PHPUnit_Framework_TestCase ...@@ -68,9 +68,9 @@ class AdapterChainEventTest extends \PHPUnit_Framework_TestCase
public function testRequest() public function testRequest()
{ {
$request = $this->getMock('Zend\Stdlib\RequestInterface'); $request = $this->getMock('Laminas\Stdlib\RequestInterface');
$this->event->setRequest($request); $this->event->setRequest($request);
$this->assertInstanceOf('Zend\Stdlib\RequestInterface', $this->event->getRequest()); $this->assertInstanceOf('Laminas\Stdlib\RequestInterface', $this->event->getRequest());
} }
} }
...@@ -14,7 +14,7 @@ class AdapterChainServiceFactoryTest extends \PHPUnit_Framework_TestCase ...@@ -14,7 +14,7 @@ class AdapterChainServiceFactoryTest extends \PHPUnit_Framework_TestCase
protected $factory; protected $factory;
/** /**
* @var \Zend\ServiceManager\ServiceLocatorInterface * @var \Laminas\ServiceManager\ServiceLocatorInterface
*/ */
protected $serviceLocator; protected $serviceLocator;
...@@ -24,7 +24,7 @@ class AdapterChainServiceFactoryTest extends \PHPUnit_Framework_TestCase ...@@ -24,7 +24,7 @@ class AdapterChainServiceFactoryTest extends \PHPUnit_Framework_TestCase
protected $options; protected $options;
/** /**
* @var \Zend\EventManager\EventManagerInterface * @var \Laminas\EventManager\EventManagerInterface
*/ */
protected $eventManager; protected $eventManager;
...@@ -41,7 +41,7 @@ class AdapterChainServiceFactoryTest extends \PHPUnit_Framework_TestCase ...@@ -41,7 +41,7 @@ class AdapterChainServiceFactoryTest extends \PHPUnit_Framework_TestCase
*/ */
protected function setUp() protected function setUp()
{ {
$this->serviceLocator = $this->getMock('Zend\ServiceManager\ServiceLocatorInterface'); $this->serviceLocator = $this->getMock('Laminas\ServiceManager\ServiceLocatorInterface');
$this->options = $this->getMockBuilder('ZfcUser\Options\ModuleOptions') $this->options = $this->getMockBuilder('ZfcUser\Options\ModuleOptions')
->disableOriginalConstructor() ->disableOriginalConstructor()
...@@ -55,7 +55,7 @@ class AdapterChainServiceFactoryTest extends \PHPUnit_Framework_TestCase ...@@ -55,7 +55,7 @@ class AdapterChainServiceFactoryTest extends \PHPUnit_Framework_TestCase
->method('get') ->method('get')
->will($this->returnCallback(array($this,'helperServiceLocator'))); ->will($this->returnCallback(array($this,'helperServiceLocator')));
$this->eventManager = $this->getMock('Zend\EventManager\EventManager'); $this->eventManager = $this->getMock('Laminas\EventManager\EventManager');
$this->factory = new AdapterChainServiceFactory(); $this->factory = new AdapterChainServiceFactory();
} }
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
namespace ZfcUserTest\Authentication\Adapter; namespace ZfcUserTest\Authentication\Adapter;
use Zend\EventManager\EventInterface; use Laminas\EventManager\EventInterface;
use Zend\EventManager\EventManagerInterface; use Laminas\EventManager\EventManagerInterface;
use Zend\EventManager\SharedEventManagerInterface; use Laminas\EventManager\SharedEventManagerInterface;
use ZfcUser\Authentication\Adapter\AdapterChain; use ZfcUser\Authentication\Adapter\AdapterChain;
use ZfcUser\Authentication\Adapter\AdapterChainEvent; use ZfcUser\Authentication\Adapter\AdapterChainEvent;
use Zend\Stdlib\RequestInterface; use Laminas\Stdlib\RequestInterface;
class AdapterChainTest extends \PHPUnit_Framework_TestCase class AdapterChainTest extends \PHPUnit_Framework_TestCase
{ {
...@@ -56,10 +56,10 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase ...@@ -56,10 +56,10 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase
$this->adapterChain = new AdapterChain(); $this->adapterChain = new AdapterChain();
$this->sharedEventManager = $this->getMock('Zend\EventManager\SharedEventManagerInterface'); $this->sharedEventManager = $this->getMock('Laminas\EventManager\SharedEventManagerInterface');
//$this->sharedEventManager->expects($this->any())->method('getListeners')->will($this->returnValue([])); //$this->sharedEventManager->expects($this->any())->method('getListeners')->will($this->returnValue([]));
$this->eventManager = $this->getMock('Zend\EventManager\EventManagerInterface'); $this->eventManager = $this->getMock('Laminas\EventManager\EventManagerInterface');
$this->eventManager->expects($this->any())->method('getSharedManager')->will($this->returnValue($this->sharedEventManager)); $this->eventManager->expects($this->any())->method('getSharedManager')->will($this->returnValue($this->sharedEventManager));
$this->eventManager->expects($this->any())->method('setIdentifiers'); $this->eventManager->expects($this->any())->method('setIdentifiers');
...@@ -90,7 +90,7 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase ...@@ -90,7 +90,7 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase
$this->adapterChain->setEvent($event); $this->adapterChain->setEvent($event);
$result = $this->adapterChain->authenticate(); $result = $this->adapterChain->authenticate();
$this->assertInstanceOf('Zend\Authentication\Result', $result); $this->assertInstanceOf('Laminas\Authentication\Result', $result);
$this->assertEquals($result->getIdentity(), 'identity'); $this->assertEquals($result->getIdentity(), 'identity');
$this->assertEquals($result->getMessages(), array()); $this->assertEquals($result->getMessages(), array());
} }
...@@ -131,7 +131,7 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase ...@@ -131,7 +131,7 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase
*/ */
protected function setUpPrepareForAuthentication() protected function setUpPrepareForAuthentication()
{ {
$this->request = $this->getMock('Zend\Stdlib\RequestInterface'); $this->request = $this->getMock('Laminas\Stdlib\RequestInterface');
$this->event = $this->getMock('ZfcUser\Authentication\Adapter\AdapterChainEvent'); $this->event = $this->getMock('ZfcUser\Authentication\Adapter\AdapterChainEvent');
$this->event->expects($this->once())->method('setRequest')->with($this->request); $this->event->expects($this->once())->method('setRequest')->with($this->request);
...@@ -139,9 +139,9 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase ...@@ -139,9 +139,9 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase
$this->eventManager->expects($this->at(0))->method('trigger')->with('authenticate.pre'); $this->eventManager->expects($this->at(0))->method('trigger')->with('authenticate.pre');
/** /**
* @var $response \Zend\EventManager\ResponseCollection * @var $response \Laminas\EventManager\ResponseCollection
*/ */
$responses = $this->getMock('Zend\EventManager\ResponseCollection'); $responses = $this->getMock('Laminas\EventManager\ResponseCollection');
$this->eventManager->expects($this->at(1)) $this->eventManager->expects($this->at(1))
->method('trigger') ->method('trigger')
...@@ -206,7 +206,7 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase ...@@ -206,7 +206,7 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase
$result->expects($this->once())->method('stopped')->will($this->returnValue(true)); $result->expects($this->once())->method('stopped')->will($this->returnValue(true));
$lastResponse = $this->getMock('Zend\Stdlib\ResponseInterface'); $lastResponse = $this->getMock('Laminas\Stdlib\ResponseInterface');
$result->expects($this->atLeastOnce())->method('last')->will($this->returnValue($lastResponse)); $result->expects($this->atLeastOnce())->method('last')->will($this->returnValue($lastResponse));
$this->assertEquals( $this->assertEquals(
...@@ -283,7 +283,7 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase ...@@ -283,7 +283,7 @@ class AdapterChainTest extends \PHPUnit_Framework_TestCase
{ {
$testParams = array('testParam' => 'testValue'); $testParams = array('testParam' => 'testValue');
$event = new \Zend\EventManager\Event; $event = new \Laminas\EventManager\Event;
$event->setParams($testParams); $event->setParams($testParams);
$this->adapterChain->setEvent($event); $this->adapterChain->setEvent($event);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace ZfcUserTest\Authentication\Adapter; namespace ZfcUserTest\Authentication\Adapter;
use Zend\EventManager\Event; use Laminas\EventManager\Event;
use ZfcUser\Authentication\Adapter\Db; use ZfcUser\Authentication\Adapter\Db;
class DbTest extends \PHPUnit_Framework_TestCase class DbTest extends \PHPUnit_Framework_TestCase
...@@ -24,7 +24,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -24,7 +24,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
/** /**
* Mock of Storage. * Mock of Storage.
* *
* @var \Zend\Authentication\Storage\Session|\PHPUnit_Framework_MockObject_MockObject * @var \Laminas\Authentication\Storage\Session|\PHPUnit_Framework_MockObject_MockObject
*/ */
protected $storage; protected $storage;
...@@ -51,7 +51,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -51,7 +51,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
protected function setUp() protected function setUp()
{ {
$storage = $this->getMock('Zend\Authentication\Storage\Session'); $storage = $this->getMock('Laminas\Authentication\Storage\Session');
$this->storage = $storage; $this->storage = $storage;
$authEvent = $this->getMock('ZfcUser\Authentication\Adapter\AdapterChainEvent'); $authEvent = $this->getMock('ZfcUser\Authentication\Adapter\AdapterChainEvent');
...@@ -69,8 +69,8 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -69,8 +69,8 @@ class DbTest extends \PHPUnit_Framework_TestCase
$this->db = new Db; $this->db = new Db;
$this->db->setStorage($this->storage); $this->db->setStorage($this->storage);
$sessionManager = $this->getMock('Zend\Session\SessionManager'); $sessionManager = $this->getMock('Laminas\Session\SessionManager');
\Zend\Session\AbstractContainer::setDefaultManager($sessionManager); \Laminas\Session\AbstractContainer::setDefaultManager($sessionManager);
} }
/** /**
...@@ -95,7 +95,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -95,7 +95,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setCode') ->method('setCode')
->with(\Zend\Authentication\Result::SUCCESS) ->with(\Laminas\Authentication\Result::SUCCESS)
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setMessages') ->method('setMessages')
...@@ -128,7 +128,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -128,7 +128,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setCode') ->method('setCode')
->with(\Zend\Authentication\Result::FAILURE_IDENTITY_NOT_FOUND) ->with(\Laminas\Authentication\Result::FAILURE_IDENTITY_NOT_FOUND)
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setMessages') ->method('setMessages')
...@@ -161,7 +161,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -161,7 +161,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setCode') ->method('setCode')
->with(\Zend\Authentication\Result::FAILURE_UNCATEGORIZED) ->with(\Laminas\Authentication\Result::FAILURE_UNCATEGORIZED)
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setMessages') ->method('setMessages')
...@@ -201,7 +201,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -201,7 +201,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setCode') ->method('setCode')
->with(\Zend\Authentication\Result::FAILURE_CREDENTIAL_INVALID) ->with(\Laminas\Authentication\Result::FAILURE_CREDENTIAL_INVALID)
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once(1)) $this->authEvent->expects($this->once(1))
->method('setMessages') ->method('setMessages')
...@@ -250,7 +250,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -250,7 +250,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setCode') ->method('setCode')
->with(\Zend\Authentication\Result::SUCCESS) ->with(\Laminas\Authentication\Result::SUCCESS)
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setMessages') ->method('setMessages')
...@@ -304,7 +304,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -304,7 +304,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setCode') ->method('setCode')
->with(\Zend\Authentication\Result::SUCCESS) ->with(\Laminas\Authentication\Result::SUCCESS)
->will($this->returnValue($this->authEvent)); ->will($this->returnValue($this->authEvent));
$this->authEvent->expects($this->once()) $this->authEvent->expects($this->once())
->method('setMessages') ->method('setMessages')
...@@ -328,7 +328,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -328,7 +328,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
->method('getPassword') ->method('getPassword')
->will($this->returnValue('$2a$10$x05G2P803MrB3jaORBXBn.QHtiYzGQOBjQ7unpEIge.Mrz6c3KiVm')); ->will($this->returnValue('$2a$10$x05G2P803MrB3jaORBXBn.QHtiYzGQOBjQ7unpEIge.Mrz6c3KiVm'));
$bcrypt = $this->getMock('Zend\Crypt\Password\Bcrypt'); $bcrypt = $this->getMock('Laminas\Crypt\Password\Bcrypt');
$bcrypt->expects($this->once()) $bcrypt->expects($this->once())
->method('getCost') ->method('getCost')
->will($this->returnValue('10')); ->will($this->returnValue('10'));
...@@ -356,7 +356,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -356,7 +356,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
->method('setPassword') ->method('setPassword')
->with('$2a$10$D41KPuDCn6iGoESjnLee/uE/2Xo985sotVySo2HKDz6gAO4hO/Gh6'); ->with('$2a$10$D41KPuDCn6iGoESjnLee/uE/2Xo985sotVySo2HKDz6gAO4hO/Gh6');
$bcrypt = $this->getMock('Zend\Crypt\Password\Bcrypt'); $bcrypt = $this->getMock('Laminas\Crypt\Password\Bcrypt');
$bcrypt->expects($this->once()) $bcrypt->expects($this->once())
->method('getCost') ->method('getCost')
->will($this->returnValue('5')); ->will($this->returnValue('5'));
...@@ -419,13 +419,13 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -419,13 +419,13 @@ class DbTest extends \PHPUnit_Framework_TestCase
*/ */
public function testSetGetServicemanager() public function testSetGetServicemanager()
{ {
$sm = $this->getMock('Zend\ServiceManager\ServiceManager'); $sm = $this->getMock('Laminas\ServiceManager\ServiceManager');
$this->db->setServiceManager($sm); $this->db->setServiceManager($sm);
$serviceManager = $this->db->getServiceManager(); $serviceManager = $this->db->getServiceManager();
$this->assertInstanceOf('Zend\ServiceManager\ServiceLocatorInterface', $serviceManager); $this->assertInstanceOf('Laminas\ServiceManager\ServiceLocatorInterface', $serviceManager);
$this->assertSame($sm, $serviceManager); $this->assertSame($sm, $serviceManager);
} }
...@@ -434,7 +434,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -434,7 +434,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
*/ */
public function testGetOptionsWithNoOptionsSet() public function testGetOptionsWithNoOptionsSet()
{ {
$serviceMapper = $this->getMock('Zend\ServiceManager\ServiceManager'); $serviceMapper = $this->getMock('Laminas\ServiceManager\ServiceManager');
$serviceMapper->expects($this->once()) $serviceMapper->expects($this->once())
->method('get') ->method('get')
->with('zfcuser_module_options') ->with('zfcuser_module_options')
...@@ -468,7 +468,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -468,7 +468,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
*/ */
public function testGetMapperWithNoMapperSet() public function testGetMapperWithNoMapperSet()
{ {
$serviceMapper = $this->getMock('Zend\ServiceManager\ServiceManager'); $serviceMapper = $this->getMock('Laminas\ServiceManager\ServiceManager');
$serviceMapper->expects($this->once()) $serviceMapper->expects($this->once())
->method('get') ->method('get')
->with('zfcuser_user_mapper') ->with('zfcuser_user_mapper')
...@@ -526,7 +526,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -526,7 +526,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
->method('read') ->method('read')
->will($this->returnValue(array('is_satisfied' => false))); ->will($this->returnValue(array('is_satisfied' => false)));
$post = $this->getMock('Zend\Stdlib\Parameters'); $post = $this->getMock('Laminas\Stdlib\Parameters');
$post->expects($this->at(0)) $post->expects($this->at(0))
->method('get') ->method('get')
->with('identity') ->with('identity')
...@@ -536,7 +536,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -536,7 +536,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
->with('credential') ->with('credential')
->will($this->returnValue($credential)); ->will($this->returnValue($credential));
$request = $this->getMock('Zend\Http\Request'); $request = $this->getMock('Laminas\Http\Request');
$request->expects($this->exactly(2)) $request->expects($this->exactly(2))
->method('getPost') ->method('getPost')
->will($this->returnValue($post)); ->will($this->returnValue($post));
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
namespace ZfcUserTest\Authentication\Adapter\TestAsset; namespace ZfcUserTest\Authentication\Adapter\TestAsset;
use Zend\EventManager\EventInterface; use Laminas\EventManager\EventInterface;
use ZfcUser\Authentication\Adapter\AbstractAdapter; use ZfcUser\Authentication\Adapter\AbstractAdapter;
class AbstractAdapterExtension extends AbstractAdapter class AbstractAdapterExtension extends AbstractAdapter
......
...@@ -32,7 +32,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -32,7 +32,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
$db = new Db; $db = new Db;
$this->db = $db; $this->db = $db;
$this->storage = $this->getMock('Zend\Authentication\Storage\Session'); $this->storage = $this->getMock('Laminas\Authentication\Storage\Session');
$this->mapper = $this->getMock('ZfcUser\Mapper\User'); $this->mapper = $this->getMock('ZfcUser\Mapper\User');
} }
...@@ -175,7 +175,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -175,7 +175,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
*/ */
public function testGetMapperWithNoMapperSet() public function testGetMapperWithNoMapperSet()
{ {
$sm = $this->getMock('Zend\ServiceManager\ServiceManager'); $sm = $this->getMock('Laminas\ServiceManager\ServiceManager');
$sm->expects($this->once()) $sm->expects($this->once())
->method('get') ->method('get')
->with('zfcuser_user_mapper') ->with('zfcuser_user_mapper')
...@@ -207,11 +207,11 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -207,11 +207,11 @@ class DbTest extends \PHPUnit_Framework_TestCase
*/ */
public function testSetGetServicemanager() public function testSetGetServicemanager()
{ {
$sm = $this->getMock('Zend\ServiceManager\ServiceManager'); $sm = $this->getMock('Laminas\ServiceManager\ServiceManager');
$this->db->setServiceManager($sm); $this->db->setServiceManager($sm);
$this->assertInstanceOf('Zend\ServiceManager\ServiceLocatorInterface', $this->db->getServiceManager()); $this->assertInstanceOf('Laminas\ServiceManager\ServiceLocatorInterface', $this->db->getServiceManager());
$this->assertSame($sm, $this->db->getServiceManager()); $this->assertSame($sm, $this->db->getServiceManager());
} }
...@@ -221,7 +221,7 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -221,7 +221,7 @@ class DbTest extends \PHPUnit_Framework_TestCase
*/ */
public function testGetStorageWithoutStorageSet() public function testGetStorageWithoutStorageSet()
{ {
$this->assertInstanceOf('Zend\Authentication\Storage\Session', $this->db->getStorage()); $this->assertInstanceOf('Laminas\Authentication\Storage\Session', $this->db->getStorage());
} }
/** /**
...@@ -230,9 +230,9 @@ class DbTest extends \PHPUnit_Framework_TestCase ...@@ -230,9 +230,9 @@ class DbTest extends \PHPUnit_Framework_TestCase
*/ */
public function testSetGetStorage() public function testSetGetStorage()
{ {
$storage = new \Zend\Authentication\Storage\Session('ZfcUserStorage'); $storage = new \Laminas\Authentication\Storage\Session('ZfcUserStorage');
$this->db->setStorage($storage); $this->db->setStorage($storage);
$this->assertInstanceOf('Zend\Authentication\Storage\Session', $this->db->getStorage()); $this->assertInstanceOf('Laminas\Authentication\Storage\Session', $this->db->getStorage());
} }
} }
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
namespace ZfcUserTest\Controller\Plugin; namespace ZfcUserTest\Controller\Plugin;
use ZfcUser\Controller\Plugin\ZfcUserAuthentication as Plugin; use ZfcUser\Controller\Plugin\ZfcUserAuthentication as Plugin;
use Zend\Authentication\AuthenticationService; use Laminas\Authentication\AuthenticationService;
use Zend\Authentication\Adapter\AdapterInterface; use Laminas\Authentication\Adapter\AdapterInterface;
use ZfcUser\Authentication\Adapter\AdapterChain; use ZfcUser\Authentication\Adapter\AdapterChain;
class ZfcUserAuthenticationTest extends \PHPUnit_Framework_TestCase class ZfcUserAuthenticationTest extends \PHPUnit_Framework_TestCase
...@@ -30,7 +30,7 @@ class ZfcUserAuthenticationTest extends \PHPUnit_Framework_TestCase ...@@ -30,7 +30,7 @@ class ZfcUserAuthenticationTest extends \PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
$this->SUT = new Plugin(); $this->SUT = new Plugin();
$this->mockedAuthenticationService = $this->getMock('Zend\Authentication\AuthenticationService'); $this->mockedAuthenticationService = $this->getMock('Laminas\Authentication\AuthenticationService');
$this->mockedAuthenticationAdapter = $this->getMockForAbstractClass('\ZfcUser\Authentication\Adapter\AdapterChain'); $this->mockedAuthenticationAdapter = $this->getMockForAbstractClass('\ZfcUser\Authentication\Adapter\AdapterChain');
} }
...@@ -78,12 +78,12 @@ class ZfcUserAuthenticationTest extends \PHPUnit_Framework_TestCase ...@@ -78,12 +78,12 @@ class ZfcUserAuthenticationTest extends \PHPUnit_Framework_TestCase
$adapter2 = new AdapterChain(); $adapter2 = new AdapterChain();
$this->SUT->setAuthAdapter($adapter1); $this->SUT->setAuthAdapter($adapter1);
$this->assertInstanceOf('\Zend\Authentication\Adapter\AdapterInterface', $this->SUT->getAuthAdapter()); $this->assertInstanceOf('\Laminas\Authentication\Adapter\AdapterInterface', $this->SUT->getAuthAdapter());
$this->assertSame($adapter1, $this->SUT->getAuthAdapter()); $this->assertSame($adapter1, $this->SUT->getAuthAdapter());
$this->SUT->setAuthAdapter($adapter2); $this->SUT->setAuthAdapter($adapter2);
$this->assertInstanceOf('\Zend\Authentication\Adapter\AdapterInterface', $this->SUT->getAuthAdapter()); $this->assertInstanceOf('\Laminas\Authentication\Adapter\AdapterInterface', $this->SUT->getAuthAdapter());
$this->assertNotSame($adapter1, $this->SUT->getAuthAdapter()); $this->assertNotSame($adapter1, $this->SUT->getAuthAdapter());
$this->assertSame($adapter2, $this->SUT->getAuthAdapter()); $this->assertSame($adapter2, $this->SUT->getAuthAdapter());
} }
...@@ -98,12 +98,12 @@ class ZfcUserAuthenticationTest extends \PHPUnit_Framework_TestCase ...@@ -98,12 +98,12 @@ class ZfcUserAuthenticationTest extends \PHPUnit_Framework_TestCase
$service2 = new AuthenticationService(); $service2 = new AuthenticationService();
$this->SUT->setAuthService($service1); $this->SUT->setAuthService($service1);
$this->assertInstanceOf('\Zend\Authentication\AuthenticationService', $this->SUT->getAuthService()); $this->assertInstanceOf('\Laminas\Authentication\AuthenticationService', $this->SUT->getAuthService());
$this->assertSame($service1, $this->SUT->getAuthService()); $this->assertSame($service1, $this->SUT->getAuthService());
$this->SUT->setAuthService($service2); $this->SUT->setAuthService($service2);
$this->assertInstanceOf('\Zend\Authentication\AuthenticationService', $this->SUT->getAuthService()); $this->assertInstanceOf('\Laminas\Authentication\AuthenticationService', $this->SUT->getAuthService());
$this->assertNotSame($service1, $this->SUT->getAuthService()); $this->assertNotSame($service1, $this->SUT->getAuthService());
$this->assertSame($service2, $this->SUT->getAuthService()); $this->assertSame($service2, $this->SUT->getAuthService());
} }
......
...@@ -2,12 +2,12 @@ ...@@ -2,12 +2,12 @@
namespace ZfcUserTest\Controller; namespace ZfcUserTest\Controller;
use Zend\Http\PhpEnvironment\Request; use Laminas\Http\PhpEnvironment\Request;
use Zend\Http\PhpEnvironment\Response; use Laminas\Http\PhpEnvironment\Response;
use Zend\Mvc\Application; use Laminas\Mvc\Application;
use Zend\Mvc\MvcEvent; use Laminas\Mvc\MvcEvent;
use Zend\Router\RouteInterface; use Laminas\Router\RouteInterface;
use Zend\Router\RouteMatch; use Laminas\Router\RouteMatch;
use ZfcUser\Controller\RedirectCallback; use ZfcUser\Controller\RedirectCallback;
use ZfcUser\Options\ModuleOptions; use ZfcUser\Options\ModuleOptions;
...@@ -40,7 +40,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase ...@@ -40,7 +40,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase
public function setUp() public function setUp()
{ {
$this->router = $this->getMockBuilder('Zend\Router\RouteInterface') $this->router = $this->getMockBuilder('Laminas\Router\RouteInterface')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
...@@ -48,7 +48,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase ...@@ -48,7 +48,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->application = $this->getMockBuilder('Zend\Mvc\Application') $this->application = $this->getMockBuilder('Laminas\Mvc\Application')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->setUpApplication(); $this->setUpApplication();
...@@ -68,7 +68,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase ...@@ -68,7 +68,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase
->method('getMatchedRouteName') ->method('getMatchedRouteName')
->will($this->returnValue('someRoute')); ->will($this->returnValue('someRoute'));
$headers = $this->getMock('Zend\Http\Headers'); $headers = $this->getMock('Laminas\Http\Headers');
$headers->expects($this->once()) $headers->expects($this->once())
->method('addHeaderLine') ->method('addHeaderLine')
->with('Location', $url); ->with('Location', $url);
...@@ -146,11 +146,11 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase ...@@ -146,11 +146,11 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase
array('user', false, $this->returnValue('route'), false), array('user', false, $this->returnValue('route'), false),
array('user', false, $this->returnValue('route'), $this->returnValue(true)), array('user', false, $this->returnValue('route'), $this->returnValue(true)),
array('user', 'user', $this->returnValue('route'), $this->returnValue(true)), array('user', 'user', $this->returnValue('route'), $this->returnValue(true)),
array('user', 'user', $this->throwException(new \Zend\Router\Exception\RuntimeException), $this->returnValue(true)), array('user', 'user', $this->throwException(new \Laminas\Router\Exception\RuntimeException), $this->returnValue(true)),
array('user', 'user', $this->throwException(new \Zend\Router\Exception\RuntimeException), $this->throwException(new \Zend\Router\Exception\RuntimeException)), array('user', 'user', $this->throwException(new \Laminas\Router\Exception\RuntimeException), $this->throwException(new \Laminas\Router\Exception\RuntimeException)),
array(false, 'user', false, $this->returnValue(true)), array(false, 'user', false, $this->returnValue(true)),
array(false, 'user', false, $this->throwException(new \Zend\Router\Exception\RuntimeException)), array(false, 'user', false, $this->throwException(new \Laminas\Router\Exception\RuntimeException)),
array(false, 'user', false, $this->throwException(new \Zend\Router\Exception\RuntimeException)), array(false, 'user', false, $this->throwException(new \Laminas\Router\Exception\RuntimeException)),
); );
} }
...@@ -179,7 +179,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase ...@@ -179,7 +179,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase
$this->router->expects($this->once()) $this->router->expects($this->once())
->method('assemble') ->method('assemble')
->with(array(), array('name' => $route)) ->with(array(), array('name' => $route))
->will($this->throwException(new \Zend\Router\Exception\RuntimeException)); ->will($this->throwException(new \Laminas\Router\Exception\RuntimeException));
$method = new \ReflectionMethod( $method = new \ReflectionMethod(
'ZfcUser\Controller\RedirectCallback', 'ZfcUser\Controller\RedirectCallback',
...@@ -274,7 +274,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase ...@@ -274,7 +274,7 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase
$this->router->expects($this->at(0)) $this->router->expects($this->at(0))
->method('assemble') ->method('assemble')
->with(array(), array('name' => $redirect)) ->with(array(), array('name' => $redirect))
->will($this->throwException(new \Zend\Router\Exception\RuntimeException)); ->will($this->throwException(new \Laminas\Router\Exception\RuntimeException));
$this->router->expects($this->at(1)) $this->router->expects($this->at(1))
->method('assemble') ->method('assemble')
...@@ -297,19 +297,19 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase ...@@ -297,19 +297,19 @@ class RedirectCallbackTest extends \PHPUnit_Framework_TestCase
private function setUpApplication() private function setUpApplication()
{ {
$this->request = $this->getMockBuilder('Zend\Http\PhpEnvironment\Request') $this->request = $this->getMockBuilder('Laminas\Http\PhpEnvironment\Request')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->response = $this->getMockBuilder('Zend\Http\PhpEnvironment\Response') $this->response = $this->getMockBuilder('Laminas\Http\PhpEnvironment\Response')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->routeMatch = $this->getMockBuilder('Zend\Router\RouteMatch') $this->routeMatch = $this->getMockBuilder('Laminas\Router\RouteMatch')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->mvcEvent = $this->getMockBuilder('Zend\Mvc\MvcEvent') $this->mvcEvent = $this->getMockBuilder('Laminas\Mvc\MvcEvent')
->disableOriginalConstructor() ->disableOriginalConstructor()
->getMock(); ->getMock();
$this->mvcEvent->expects($this->any()) $this->mvcEvent->expects($this->any())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment