Loading tests/BjyAuthorizeTest/Collector/RoleCollectorTest.php +5 −5 Changes for tests/BjyAuthorizeTest/Collector/RoleCollectorTest.php: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class RoleCollectorTest extends TestCase */ public function setUp() { $this->identityProvider = $this->getMock('BjyAuthorize\\Provider\\Identity\\ProviderInterface'); $this->identityProvider = $this->createMock('BjyAuthorize\\Provider\\Identity\\ProviderInterface'); $this->collector = new RoleCollector($this->identityProvider); } Loading @@ -47,8 +47,8 @@ class RoleCollectorTest extends TestCase */ public function testCollect() { $role1 = $this->getMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $mvcEvent = $this->getMock('Zend\\Mvc\\MvcEvent'); $role1 = $this->createMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $mvcEvent = $this->createMock('Zend\\Mvc\\MvcEvent'); $role1->expects($this->any())->method('getRoleId')->will($this->returnValue('role1')); Loading Loading @@ -94,8 +94,8 @@ class RoleCollectorTest extends TestCase */ public function testTraversableCollect() { $role1 = $this->getMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $mvcEvent = $this->getMock('Zend\\Mvc\\MvcEvent'); $role1 = $this->createMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $mvcEvent = $this->createMock('Zend\\Mvc\\MvcEvent'); $role1->expects($this->any())->method('getRoleId')->will($this->returnValue('role1')); Loading tests/BjyAuthorizeTest/Controller/Plugin/IsAllowedTest.php +2 −2 Changes for tests/BjyAuthorizeTest/Controller/Plugin/IsAllowedTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class IsAllowedTest extends TestCase */ public function testIsAllowed() { $authorize = $this->getMock('BjyAuthorize\\Service\\Authorize', array(), array(), '', false); $authorize = $this->createMock('BjyAuthorize\\Service\\Authorize'/*, array(), array(), '', false*/); $authorize ->expects($this->once()) ->method('isAllowed') Loading @@ -33,7 +33,7 @@ class IsAllowedTest extends TestCase $plugin = new IsAllowed($authorize); $this->assertTrue($plugin->__invoke('test', 'privilege')); $authorize2 = $this->getMock('BjyAuthorize\\Service\\Authorize', array(), array(), '', false); $authorize2 = $this->createMock('BjyAuthorize\\Service\\Authorize'/*, array(), array(), '', false*/); $authorize2 ->expects($this->once()) ->method('isAllowed') Loading tests/BjyAuthorizeTest/Guard/ControllerTest.php +9 −9 Changes for tests/BjyAuthorizeTest/Guard/ControllerTest.php: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -43,8 +43,8 @@ class ControllerTest extends TestCase { parent::setUp(); $this->serviceLocator = $locator = $this->getMock('Zend\\ServiceManager\\ServiceLocatorInterface'); $this->authorize = $authorize = $this->getMock('BjyAuthorize\\Service\\Authorize', array(), array(), '', false); $this->serviceLocator = $locator = $this->createMock('Zend\\ServiceManager\\ServiceLocatorInterface'); $this->authorize = $authorize = $this->createMock('BjyAuthorize\\Service\\Authorize'/*, array(), array(), '', false*/); $this->controllerGuard = new Controller(array(), $this->serviceLocator); $this Loading @@ -61,8 +61,8 @@ class ControllerTest extends TestCase */ public function testAttachDetach() { $eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface'); $callbackMock = $this->getMock('Zend\\Stdlib\\CallbackHandler', array(), array(), '', false); $eventManager = $this->createMock('Zend\\EventManager\\EventManagerInterface'); $callbackMock = $this->createMock('Zend\\Stdlib\\CallbackHandler'/*, array(), array(), '', false*/); $eventManager ->expects($this->once()) ->method('attach') Loading Loading @@ -259,11 +259,11 @@ class ControllerTest extends TestCase */ private function createMvcEvent($controller = null, $action = null, $method = null) { $eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface'); $application = $this->getMock('Zend\\Mvc\\Application', array(), array(), '', false); $event = $this->getMock('Zend\\Mvc\\MvcEvent'); $routeMatch = $this->getMock('Zend\\Mvc\\Router\\RouteMatch', array(), array(), '', false); $request = $this->getMock('Zend\\Http\\Request'); $eventManager = $this->createMock('Zend\\EventManager\\EventManagerInterface'); $application = $this->createMock('Zend\\Mvc\\Application'/*, array(), array(), '', false*/); $event = $this->createMock('Zend\\Mvc\\MvcEvent'); $routeMatch = $this->createMock('Zend\\Mvc\\Router\\RouteMatch'/*, array(), array(), '', false*/); $request = $this->createMock('Zend\\Http\\Request'); $event->expects($this->any())->method('getRouteMatch')->will($this->returnValue($routeMatch)); $event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); Loading tests/BjyAuthorizeTest/Guard/RouteTest.php +9 −9 Changes for tests/BjyAuthorizeTest/Guard/RouteTest.php: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -43,8 +43,8 @@ class RouteTest extends TestCase { parent::setUp(); $this->serviceLocator = $this->getMock('Zend\\ServiceManager\\ServiceLocatorInterface'); $this->authorize = $authorize = $this->getMock('BjyAuthorize\\Service\\Authorize', array(), array(), '', false); $this->serviceLocator = $this->createMock('Zend\\ServiceManager\\ServiceLocatorInterface'); $this->authorize = $authorize = $this->createMock('BjyAuthorize\\Service\\Authorize'/*, array(), array(), '', false*/); $this->routeGuard = new Route(array(), $this->serviceLocator); $this Loading @@ -61,8 +61,8 @@ class RouteTest extends TestCase */ public function testAttachDetach() { $eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface'); $callbackMock = $this->getMock('Zend\\Stdlib\\CallbackHandler', array(), array(), '', false); $eventManager = $this->createMock('Zend\\EventManager\\EventManagerInterface'); $callbackMock = $this->createMock('Zend\\Stdlib\\CallbackHandler'/*, array(), array(), '', false*/); $eventManager ->expects($this->once()) ->method('attach') Loading Loading @@ -221,11 +221,11 @@ class RouteTest extends TestCase */ private function createMvcEvent($route = null) { $eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface'); $application = $this->getMock('Zend\\Mvc\\Application', array(), array(), '', false); $event = $this->getMock('Zend\\Mvc\\MvcEvent'); $routeMatch = $this->getMock('Zend\\Mvc\\Router\\RouteMatch', array(), array(), '', false); $request = $this->getMock('Zend\\Http\\Request'); $eventManager = $this->createMock('Zend\\EventManager\\EventManagerInterface'); $application = $this->createMock('Zend\\Mvc\\Application'/*, array(), array(), '', false*/); $event = $this->createMock('Zend\\Mvc\\MvcEvent'); $routeMatch = $this->createMock('Zend\\Mvc\\Router\\RouteMatch'/*, array(), array(), '', false*/); $request = $this->createMock('Zend\\Http\\Request'); $event->expects($this->any())->method('getRouteMatch')->will($this->returnValue($routeMatch)); $event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); Loading tests/BjyAuthorizeTest/Provider/Identity/AuthenticationIdentityProviderTest.php +9 −9 Changes for tests/BjyAuthorizeTest/Provider/Identity/AuthenticationIdentityProviderTest.php: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class AuthenticationIdentityProviderTest extends TestCase */ public function setUp() { $this->authService = $this->getMock('Zend\Authentication\AuthenticationService'); $this->authService = $this->createMock('Zend\Authentication\AuthenticationService'); $this->provider = new AuthenticationIdentityProvider($this->authService); } Loading Loading @@ -72,7 +72,7 @@ class AuthenticationIdentityProviderTest extends TestCase { $this->authService->expects($this->once())->method('getIdentity')->will($this->returnValue('foo')); $authorizedRole = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface', array('getRoleId')); $authorizedRole = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'/*, array('getRoleId')*/); $this->provider->setAuthenticatedRole($authorizedRole); Loading @@ -86,7 +86,7 @@ class AuthenticationIdentityProviderTest extends TestCase { $this->authService->expects($this->once())->method('getIdentity')->will($this->returnValue(null)); $defaultRole = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface', array('getRoleId')); $defaultRole = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'/*, array('getRoleId')*/); $this->provider->setDefaultRole($defaultRole); Loading @@ -98,9 +98,9 @@ class AuthenticationIdentityProviderTest extends TestCase */ public function testGetIdentityRolesRetrievesRolesFromIdentityThatIsARoleProvider() { $role1 = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface'); $role2 = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface'); $user = $this->getMock('BjyAuthorize\Provider\Role\ProviderInterface'); $role1 = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'); $role2 = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'); $user = $this->createMock('BjyAuthorize\Provider\Role\ProviderInterface'); $user->expects($this->once()) ->method('getRoles') Loading @@ -122,7 +122,7 @@ class AuthenticationIdentityProviderTest extends TestCase */ public function testGetIdentityRolesRetrievesIdentityThatIsARole() { $user = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface'); $user = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'); $this->authService->expects($this->any()) ->method('getIdentity') Loading @@ -141,7 +141,7 @@ class AuthenticationIdentityProviderTest extends TestCase $this->provider->setAuthenticatedRole('test'); $this->assertSame('test', $this->provider->getAuthenticatedRole()); $role = $this->getMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $role = $this->createMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $this->provider->setAuthenticatedRole($role); $this->assertSame($role, $this->provider->getAuthenticatedRole()); Loading @@ -159,7 +159,7 @@ class AuthenticationIdentityProviderTest extends TestCase $this->provider->setDefaultRole('test'); $this->assertSame('test', $this->provider->getDefaultRole()); $role = $this->getMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $role = $this->createMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $this->provider->setDefaultRole($role); $this->assertSame($role, $this->provider->getDefaultRole()); Loading Loading
tests/BjyAuthorizeTest/Collector/RoleCollectorTest.php +5 −5 Changes for tests/BjyAuthorizeTest/Collector/RoleCollectorTest.php: 5 added lines, 5 removed lines. Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class RoleCollectorTest extends TestCase */ public function setUp() { $this->identityProvider = $this->getMock('BjyAuthorize\\Provider\\Identity\\ProviderInterface'); $this->identityProvider = $this->createMock('BjyAuthorize\\Provider\\Identity\\ProviderInterface'); $this->collector = new RoleCollector($this->identityProvider); } Loading @@ -47,8 +47,8 @@ class RoleCollectorTest extends TestCase */ public function testCollect() { $role1 = $this->getMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $mvcEvent = $this->getMock('Zend\\Mvc\\MvcEvent'); $role1 = $this->createMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $mvcEvent = $this->createMock('Zend\\Mvc\\MvcEvent'); $role1->expects($this->any())->method('getRoleId')->will($this->returnValue('role1')); Loading Loading @@ -94,8 +94,8 @@ class RoleCollectorTest extends TestCase */ public function testTraversableCollect() { $role1 = $this->getMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $mvcEvent = $this->getMock('Zend\\Mvc\\MvcEvent'); $role1 = $this->createMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $mvcEvent = $this->createMock('Zend\\Mvc\\MvcEvent'); $role1->expects($this->any())->method('getRoleId')->will($this->returnValue('role1')); Loading
tests/BjyAuthorizeTest/Controller/Plugin/IsAllowedTest.php +2 −2 Changes for tests/BjyAuthorizeTest/Controller/Plugin/IsAllowedTest.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ class IsAllowedTest extends TestCase */ public function testIsAllowed() { $authorize = $this->getMock('BjyAuthorize\\Service\\Authorize', array(), array(), '', false); $authorize = $this->createMock('BjyAuthorize\\Service\\Authorize'/*, array(), array(), '', false*/); $authorize ->expects($this->once()) ->method('isAllowed') Loading @@ -33,7 +33,7 @@ class IsAllowedTest extends TestCase $plugin = new IsAllowed($authorize); $this->assertTrue($plugin->__invoke('test', 'privilege')); $authorize2 = $this->getMock('BjyAuthorize\\Service\\Authorize', array(), array(), '', false); $authorize2 = $this->createMock('BjyAuthorize\\Service\\Authorize'/*, array(), array(), '', false*/); $authorize2 ->expects($this->once()) ->method('isAllowed') Loading
tests/BjyAuthorizeTest/Guard/ControllerTest.php +9 −9 Changes for tests/BjyAuthorizeTest/Guard/ControllerTest.php: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -43,8 +43,8 @@ class ControllerTest extends TestCase { parent::setUp(); $this->serviceLocator = $locator = $this->getMock('Zend\\ServiceManager\\ServiceLocatorInterface'); $this->authorize = $authorize = $this->getMock('BjyAuthorize\\Service\\Authorize', array(), array(), '', false); $this->serviceLocator = $locator = $this->createMock('Zend\\ServiceManager\\ServiceLocatorInterface'); $this->authorize = $authorize = $this->createMock('BjyAuthorize\\Service\\Authorize'/*, array(), array(), '', false*/); $this->controllerGuard = new Controller(array(), $this->serviceLocator); $this Loading @@ -61,8 +61,8 @@ class ControllerTest extends TestCase */ public function testAttachDetach() { $eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface'); $callbackMock = $this->getMock('Zend\\Stdlib\\CallbackHandler', array(), array(), '', false); $eventManager = $this->createMock('Zend\\EventManager\\EventManagerInterface'); $callbackMock = $this->createMock('Zend\\Stdlib\\CallbackHandler'/*, array(), array(), '', false*/); $eventManager ->expects($this->once()) ->method('attach') Loading Loading @@ -259,11 +259,11 @@ class ControllerTest extends TestCase */ private function createMvcEvent($controller = null, $action = null, $method = null) { $eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface'); $application = $this->getMock('Zend\\Mvc\\Application', array(), array(), '', false); $event = $this->getMock('Zend\\Mvc\\MvcEvent'); $routeMatch = $this->getMock('Zend\\Mvc\\Router\\RouteMatch', array(), array(), '', false); $request = $this->getMock('Zend\\Http\\Request'); $eventManager = $this->createMock('Zend\\EventManager\\EventManagerInterface'); $application = $this->createMock('Zend\\Mvc\\Application'/*, array(), array(), '', false*/); $event = $this->createMock('Zend\\Mvc\\MvcEvent'); $routeMatch = $this->createMock('Zend\\Mvc\\Router\\RouteMatch'/*, array(), array(), '', false*/); $request = $this->createMock('Zend\\Http\\Request'); $event->expects($this->any())->method('getRouteMatch')->will($this->returnValue($routeMatch)); $event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); Loading
tests/BjyAuthorizeTest/Guard/RouteTest.php +9 −9 Changes for tests/BjyAuthorizeTest/Guard/RouteTest.php: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -43,8 +43,8 @@ class RouteTest extends TestCase { parent::setUp(); $this->serviceLocator = $this->getMock('Zend\\ServiceManager\\ServiceLocatorInterface'); $this->authorize = $authorize = $this->getMock('BjyAuthorize\\Service\\Authorize', array(), array(), '', false); $this->serviceLocator = $this->createMock('Zend\\ServiceManager\\ServiceLocatorInterface'); $this->authorize = $authorize = $this->createMock('BjyAuthorize\\Service\\Authorize'/*, array(), array(), '', false*/); $this->routeGuard = new Route(array(), $this->serviceLocator); $this Loading @@ -61,8 +61,8 @@ class RouteTest extends TestCase */ public function testAttachDetach() { $eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface'); $callbackMock = $this->getMock('Zend\\Stdlib\\CallbackHandler', array(), array(), '', false); $eventManager = $this->createMock('Zend\\EventManager\\EventManagerInterface'); $callbackMock = $this->createMock('Zend\\Stdlib\\CallbackHandler'/*, array(), array(), '', false*/); $eventManager ->expects($this->once()) ->method('attach') Loading Loading @@ -221,11 +221,11 @@ class RouteTest extends TestCase */ private function createMvcEvent($route = null) { $eventManager = $this->getMock('Zend\\EventManager\\EventManagerInterface'); $application = $this->getMock('Zend\\Mvc\\Application', array(), array(), '', false); $event = $this->getMock('Zend\\Mvc\\MvcEvent'); $routeMatch = $this->getMock('Zend\\Mvc\\Router\\RouteMatch', array(), array(), '', false); $request = $this->getMock('Zend\\Http\\Request'); $eventManager = $this->createMock('Zend\\EventManager\\EventManagerInterface'); $application = $this->createMock('Zend\\Mvc\\Application'/*, array(), array(), '', false*/); $event = $this->createMock('Zend\\Mvc\\MvcEvent'); $routeMatch = $this->createMock('Zend\\Mvc\\Router\\RouteMatch'/*, array(), array(), '', false*/); $request = $this->createMock('Zend\\Http\\Request'); $event->expects($this->any())->method('getRouteMatch')->will($this->returnValue($routeMatch)); $event->expects($this->any())->method('getRequest')->will($this->returnValue($request)); Loading
tests/BjyAuthorizeTest/Provider/Identity/AuthenticationIdentityProviderTest.php +9 −9 Changes for tests/BjyAuthorizeTest/Provider/Identity/AuthenticationIdentityProviderTest.php: 9 added lines, 9 removed lines. Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class AuthenticationIdentityProviderTest extends TestCase */ public function setUp() { $this->authService = $this->getMock('Zend\Authentication\AuthenticationService'); $this->authService = $this->createMock('Zend\Authentication\AuthenticationService'); $this->provider = new AuthenticationIdentityProvider($this->authService); } Loading Loading @@ -72,7 +72,7 @@ class AuthenticationIdentityProviderTest extends TestCase { $this->authService->expects($this->once())->method('getIdentity')->will($this->returnValue('foo')); $authorizedRole = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface', array('getRoleId')); $authorizedRole = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'/*, array('getRoleId')*/); $this->provider->setAuthenticatedRole($authorizedRole); Loading @@ -86,7 +86,7 @@ class AuthenticationIdentityProviderTest extends TestCase { $this->authService->expects($this->once())->method('getIdentity')->will($this->returnValue(null)); $defaultRole = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface', array('getRoleId')); $defaultRole = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'/*, array('getRoleId')*/); $this->provider->setDefaultRole($defaultRole); Loading @@ -98,9 +98,9 @@ class AuthenticationIdentityProviderTest extends TestCase */ public function testGetIdentityRolesRetrievesRolesFromIdentityThatIsARoleProvider() { $role1 = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface'); $role2 = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface'); $user = $this->getMock('BjyAuthorize\Provider\Role\ProviderInterface'); $role1 = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'); $role2 = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'); $user = $this->createMock('BjyAuthorize\Provider\Role\ProviderInterface'); $user->expects($this->once()) ->method('getRoles') Loading @@ -122,7 +122,7 @@ class AuthenticationIdentityProviderTest extends TestCase */ public function testGetIdentityRolesRetrievesIdentityThatIsARole() { $user = $this->getMock('Zend\Permissions\Acl\Role\RoleInterface'); $user = $this->createMock('Zend\Permissions\Acl\Role\RoleInterface'); $this->authService->expects($this->any()) ->method('getIdentity') Loading @@ -141,7 +141,7 @@ class AuthenticationIdentityProviderTest extends TestCase $this->provider->setAuthenticatedRole('test'); $this->assertSame('test', $this->provider->getAuthenticatedRole()); $role = $this->getMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $role = $this->createMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $this->provider->setAuthenticatedRole($role); $this->assertSame($role, $this->provider->getAuthenticatedRole()); Loading @@ -159,7 +159,7 @@ class AuthenticationIdentityProviderTest extends TestCase $this->provider->setDefaultRole('test'); $this->assertSame('test', $this->provider->getDefaultRole()); $role = $this->getMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $role = $this->createMock('Zend\\Permissions\\Acl\\Role\\RoleInterface'); $this->provider->setDefaultRole($role); $this->assertSame($role, $this->provider->getDefaultRole()); Loading