Completed
Pull Request — master (#524)
by Mathias
21:52 queued 12:46
created
module/Auth/test/TestConfig.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -6,9 +6,9 @@  discard block
 block discarded – undo
6 6
     // This should be an array of module namespaces used in the application.
7 7
     'modules' => array_merge($commonModules,array(
8 8
         'Core',
9
-	    'Auth',
10
-	    'Jobs',
11
-	    'Organizations',
9
+        'Auth',
10
+        'Jobs',
11
+        'Organizations',
12 12
     )),
13 13
 
14 14
     // These are various options for the listeners attached to the ModuleManager
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     //     ),
65 65
     // )
66 66
 
67
-   // Initial configuration with which to seed the ServiceManager.
68
-   // Should be compatible with Zend\ServiceManager\Config.
69
-   // 'service_manager' => array(),
67
+    // Initial configuration with which to seed the ServiceManager.
68
+    // Should be compatible with Zend\ServiceManager\Config.
69
+    // 'service_manager' => array(),
70 70
 );
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 
5 5
 return array(
6 6
     // This should be an array of module namespaces used in the application.
7
-    'modules' => array_merge($commonModules,array(
7
+    'modules' => array_merge($commonModules, array(
8 8
         'Core',
9 9
 	    'Auth',
10 10
 	    'Jobs',
Please login to merge, or discard this patch.
Auth/test/AclTest/Assertion/AbstractEventManagerAwareAssertionTest.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
         $acl    = new Acl();
86 86
 
87 87
         $events = $this->getMockBuilder('\Zend\EventManager\EventManager')
88
-                       ->disableOriginalConstructor()
89
-                       ->getMock();
88
+                        ->disableOriginalConstructor()
89
+                        ->getMock();
90 90
 
91 91
         $events->expects($this->once())
92
-               ->method('triggerUntil')
93
-               ->willReturn(new ResponseCollection());
92
+                ->method('triggerUntil')
93
+                ->willReturn(new ResponseCollection());
94 94
 
95 95
         $target->setEventManager($events);
96 96
 
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
         $responseFalse = $this->createResponseMock(false);
113 113
 
114 114
         $events = $this->getMockBuilder('\Zend\EventManager\EventManager')
115
-                       ->disableOriginalConstructor()
116
-                       ->getMock();
115
+                        ->disableOriginalConstructor()
116
+                        ->getMock();
117 117
 
118 118
         $events->expects($this->exactly(5))
119
-               ->method('triggerUntil')
120
-               ->will($this->onConsecutiveCalls($responseNull, $responseEmpty, $responseZero, $responseTrue, $responseFalse));
119
+                ->method('triggerUntil')
120
+                ->will($this->onConsecutiveCalls($responseNull, $responseEmpty, $responseZero, $responseTrue, $responseFalse));
121 121
 
122 122
         $target->setEventManager($events);
123 123
 
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
     protected function createResponseMock($returnValue)
134 134
     {
135 135
         $response = $this->getMockBuilder('\Zend\EventManager\ResponseCollection')
136
-                             ->disableOriginalConstructor()
137
-                             ->getMock();
136
+                                ->disableOriginalConstructor()
137
+                                ->getMock();
138 138
         $response->method('last')->willReturn($returnValue);
139 139
 
140 140
         return $response;
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
         $target = new TargetMock();
146 146
 
147 147
         $events = $this->getMockBuilder('\Zend\EventManager\EventManager')
148
-                       ->disableOriginalConstructor()
149
-                       ->getMock();
148
+                        ->disableOriginalConstructor()
149
+                        ->getMock();
150 150
 
151 151
         $acl = new Acl();
152 152
         $role = new GenericRole('testRole');
@@ -155,16 +155,16 @@  discard block
 block discarded – undo
155 155
         $self = $this;
156 156
 
157 157
         $events->expects($this->once())->method('triggerUntil')
158
-               ->will($this->returnCallback(function ($callback,$eventName,$event) use ($acl, $role, $resource, $privilege, $self) {
159
-               	    $self->assertTrue(is_callable($callback));
160
-	                $self->assertEquals('assert',$eventName);
158
+                ->will($this->returnCallback(function ($callback,$eventName,$event) use ($acl, $role, $resource, $privilege, $self) {
159
+                        $self->assertTrue(is_callable($callback));
160
+                    $self->assertEquals('assert',$eventName);
161 161
                     $self->assertSame($acl, $event->getAcl());
162 162
                     $self->assertSame($role, $event->getRole());
163 163
                     $self->assertSame($resource, $event->getResource());
164 164
                     $self->assertSame($privilege, $event->getPrivilege());
165 165
 
166 166
                     return new ResponseCollection();
167
-               }));
167
+                }));
168 168
 
169 169
         $target->setEventManager($events);
170 170
         $target->assert($acl, $role, $resource, $privilege);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,9 +155,9 @@
 block discarded – undo
155 155
         $self = $this;
156 156
 
157 157
         $events->expects($this->once())->method('triggerUntil')
158
-               ->will($this->returnCallback(function ($callback,$eventName,$event) use ($acl, $role, $resource, $privilege, $self) {
158
+               ->will($this->returnCallback(function($callback, $eventName, $event) use ($acl, $role, $resource, $privilege, $self) {
159 159
                	    $self->assertTrue(is_callable($callback));
160
-	                $self->assertEquals('assert',$eventName);
160
+	                $self->assertEquals('assert', $eventName);
161 161
                     $self->assertSame($acl, $event->getAcl());
162 162
                     $self->assertSame($role, $event->getRole());
163 163
                     $self->assertSame($resource, $event->getResource());
Please login to merge, or discard this patch.
module/Auth/test/AclTest/Assertion/AssertionManagerFactoryTest.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -31,11 +31,11 @@  discard block
 block discarded – undo
31 31
     public function testCreateServiceReturnsAssertionManager()
32 32
     {
33 33
         $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')
34
-                         ->disableOriginalConstructor()
35
-                         ->getMock();
34
+                            ->disableOriginalConstructor()
35
+                            ->getMock();
36 36
 
37 37
         $services->expects($this->once())->method('get')->with('Config')
38
-                 ->willReturn(array());
38
+                    ->willReturn(array());
39 39
 
40 40
         $target = new AssertionManagerFactory();
41 41
         $manager = $target->__invoke($services,AssertionManager::class);
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
     public function testCorrectConfigIsUsedToConfigureTheManager($config, $testName, $testResult)
54 54
     {
55 55
         $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')
56
-                         ->disableOriginalConstructor()
57
-                         ->getMock();
56
+                            ->disableOriginalConstructor()
57
+                            ->getMock();
58 58
 
59 59
         $services->expects($this->once())->method('get')->with('Config')
60
-                 ->willReturn($config);
60
+                    ->willReturn($config);
61 61
 
62 62
         $target = new AssertionManagerFactory();
63 63
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                  ->willReturn(array());
39 39
 
40 40
         $target = new AssertionManagerFactory();
41
-        $manager = $target->__invoke($services,AssertionManager::class);
41
+        $manager = $target->__invoke($services, AssertionManager::class);
42 42
 
43 43
         $this->assertInstanceOf('\Acl\Assertion\AssertionManager', $manager);
44 44
         //$this->assertFalse($manager->shareByDefault(), 'The managers\' shareByDefault value must be set to FALSE by the factory.');
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 
62 62
         $target = new AssertionManagerFactory();
63 63
 
64
-        $manager = $target->__invoke($services,AssertionManager::class);
64
+        $manager = $target->__invoke($services, AssertionManager::class);
65 65
 
66
-        $this->assertTrue($testResult === $manager->has($testName), 'Expected managers\' has method to return ' . ($testResult ? 'TRUE' : 'FALSE') . ' on ' .$testName);
66
+        $this->assertTrue($testResult === $manager->has($testName), 'Expected managers\' has method to return '.($testResult ? 'TRUE' : 'FALSE').' on '.$testName);
67 67
     }
68 68
 
69 69
     public function provideConfigArrays()
Please login to merge, or discard this patch.
module/Auth/test/AclTest/Assertion/AssertionManagerTest.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -68,35 +68,35 @@  discard block
 block discarded – undo
68 68
     public function testInjectEventManagerInitializerCallbackGetsEventManagerFromServicesIfNotSetInAssertion()
69 69
     {
70 70
         $assertion = $this
71
-	        ->getMockForAbstractClass('\AclTest\Assertion\EventManagerAwareAssertionMock')
71
+            ->getMockForAbstractClass('\AclTest\Assertion\EventManagerAwareAssertionMock')
72 72
         ;
73 73
         $services = $this->getMockBuilder('\Zend\ServiceManager\AbstractPluginManager')
74
-	        ->disableOriginalConstructor()
75
-	        ->getMock()
74
+            ->disableOriginalConstructor()
75
+            ->getMock()
76 76
         ;
77 77
         $parentServices = $this
78
-	        ->getMockBuilder('\Zend\ServiceManager\ServiceManager')
79
-	        ->disableOriginalConstructor()
80
-	        ->getMock()
78
+            ->getMockBuilder('\Zend\ServiceManager\ServiceManager')
79
+            ->disableOriginalConstructor()
80
+            ->getMock()
81 81
         ;
82 82
         $events = new EventManager();
83
-	    $target = new AssertionManager($parentServices);
83
+        $target = new AssertionManager($parentServices);
84 84
         $assertion
85
-	        ->expects($this->once())
86
-	        ->method('getEventManager')
87
-	        ->willReturn(null)
85
+            ->expects($this->once())
86
+            ->method('getEventManager')
87
+            ->willReturn(null)
88 88
         ;
89 89
         $assertion
90
-	        ->expects($this->once())
91
-	        ->method('setEventManager')
92
-	        ->with($events)
90
+            ->expects($this->once())
91
+            ->method('setEventManager')
92
+            ->with($events)
93 93
         ;
94 94
 
95 95
         $parentServices
96
-	        ->expects($this->once())
97
-	        ->method('get')
98
-	        ->with('EventManager')
99
-	        ->willReturn($events)
96
+            ->expects($this->once())
97
+            ->method('get')
98
+            ->with('EventManager')
99
+            ->willReturn($events)
100 100
         ;
101 101
         /*
102 102
          * Wanted to use:
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
         $target = new AssertionManager($this->serviceManager);
116 116
         $assertion = $this->getMockForAbstractClass('\AclTest\Assertion\EventManagerAwareAssertionMock');
117 117
         $services = $this->getMockBuilder('\Zend\ServiceManager\AbstractPluginManager')
118
-	        ->disableOriginalConstructor()
119
-	        ->getMock()
118
+            ->disableOriginalConstructor()
119
+            ->getMock()
120 120
         ;
121 121
         
122 122
         $parentServices = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock();
@@ -126,15 +126,15 @@  discard block
 block discarded – undo
126 126
         //$services->setServiceLocator($parentServices);
127 127
 
128 128
         $parentServices
129
-	        ->expects($this->never())
130
-	        ->method('get')
131
-	        //->with('SharedEventManager')
132
-	        //->willReturn($sharedEvents)
129
+            ->expects($this->never())
130
+            ->method('get')
131
+            //->with('SharedEventManager')
132
+            //->willReturn($sharedEvents)
133 133
         ;
134 134
         $assertion
135
-	        ->expects($this->once())
136
-	        ->method('getEventManager')
137
-	        ->willReturn($events)
135
+            ->expects($this->once())
136
+            ->method('getEventManager')
137
+            ->willReturn($events)
138 138
         ;
139 139
 
140 140
         $this->assertNull($target->injectEventManager($assertion, $services));
Please login to merge, or discard this patch.
Auth/test/AuthTest/Factory/Controller/RemoveControllerFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,6 +49,6 @@
 block discarded – undo
49 49
             ]));
50 50
         
51 51
         $controllerFactory = new RemoveControllerFactory();
52
-        $this->assertInstanceOf(RemoveController::class, $controllerFactory($serviceLocator,'irrelevant'));
52
+        $this->assertInstanceOf(RemoveController::class, $controllerFactory($serviceLocator, 'irrelevant'));
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
Auth/test/AuthTest/Factory/Controller/Plugin/UserSwitcherFactoryTest.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@
 block discarded – undo
50 50
         $container = $this->getServiceManagerMock();
51 51
         $plugins   = $this->getPluginManagerMock($container);
52 52
         $this->target
53
-	        ->expects($this->once())
54
-	        ->method('__invoke')
55
-	        ->with($container, 'Auth/User/Switcher')
53
+            ->expects($this->once())
54
+            ->method('__invoke')
55
+            ->with($container, 'Auth/User/Switcher')
56 56
         ;
57 57
 
58 58
         $this->target->createService($container);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -39,11 +39,11 @@  discard block
 block discarded – undo
39 39
     private $target = [
40 40
         UserSwitcherFactory::class,
41 41
         '@testCreateServiceInvokesItself' => [
42
-            'mock' => [ '__invoke' ],
42
+            'mock' => ['__invoke'],
43 43
         ],
44 44
     ];
45 45
 
46
-    private $inheritance = [ FactoryInterface::class ];
46
+    private $inheritance = [FactoryInterface::class];
47 47
 
48 48
     public function testCreateServiceInvokesItself()
49 49
     {
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $auth = $this->getMockBuilder(AuthenticationService::class)->disableOriginalConstructor()->getMock();
64 64
         $acl = $this->getMockBuilder(Acl::class)->disableOriginalConstructor()->getMock();
65 65
         $sm = $this->createServiceManagerMock();
66
-        $controllerPlugins = $this->getPluginManagerMock(['Acl' => ['service' => $acl, 'count_get' => 1]],$sm);
66
+        $controllerPlugins = $this->getPluginManagerMock(['Acl' => ['service' => $acl, 'count_get' => 1]], $sm);
67 67
         $container = $this->getServiceManagerMock([
68 68
                 'AuthenticationService' => ['service' => $auth, 'count_get' => 1],
69 69
                 'ControllerPluginManager' => ['service' => $controllerPlugins, 'count_get' => 1]
Please login to merge, or discard this patch.
module/Auth/test/AuthTest/Factory/View/Helper/AuthFactoryTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
         
27 27
         $hm = new HelperPluginManager($sm);
28 28
         
29
-        $helper = $f->__invoke($sm,Auth::class);
29
+        $helper = $f->__invoke($sm, Auth::class);
30 30
         
31 31
         $this->assertInstanceOf('\Auth\View\Helper\Auth', $helper);
32 32
         $this->assertSame($auth, $helper->getService());
Please login to merge, or discard this patch.
module/Auth/test/AuthTest/Controller/ManageControllerTest.php 2 patches
Indentation   +28 added lines, -29 removed lines patch added patch discarded remove patch
@@ -18,44 +18,43 @@
 block discarded – undo
18 18
 
19 19
 /**
20 20
  * Class ManageControllerTest
21
- 
22 21
  * @package AuthTest\Controller
23 22
  */
24 23
 class ManageControllerTest extends AbstractFunctionalControllerTestCase
25 24
 {
26
-	const URL_MY_PROFILE = '/en/my/profile';
25
+    const URL_MY_PROFILE = '/en/my/profile';
27 26
 	
28
-	private $hybridAuthAdapter;
27
+    private $hybridAuthAdapter;
29 28
 	
30
-	public function setUp()
31
-	{
32
-		parent::setUp();
29
+    public function setUp()
30
+    {
31
+        parent::setUp();
33 32
 		
34
-		$this->hybridAuthAdapter = $this->getMockBuilder(HybridAuth::class)
35
-			->disableOriginalConstructor()
36
-			->getMock()
37
-		;
38
-		$this->setMockToServiceLocator('HybridAuthAdapter',$this->hybridAuthAdapter);
39
-	}
33
+        $this->hybridAuthAdapter = $this->getMockBuilder(HybridAuth::class)
34
+            ->disableOriginalConstructor()
35
+            ->getMock()
36
+        ;
37
+        $this->setMockToServiceLocator('HybridAuthAdapter',$this->hybridAuthAdapter);
38
+    }
40 39
 	
41
-	public function testAccessWhenNotLoggedIn()
42
-	{
43
-		$this->dispatch(self::URL_MY_PROFILE, Request::METHOD_GET);
40
+    public function testAccessWhenNotLoggedIn()
41
+    {
42
+        $this->dispatch(self::URL_MY_PROFILE, Request::METHOD_GET);
44 43
 		
45
-		$result = $this->getResponse()->getContent();
44
+        $result = $this->getResponse()->getContent();
46 45
 		
47
-		$this->assertNotRedirect();
48
-		$this->assertResponseStatusCode(Response::STATUS_CODE_401);
49
-		$this->assertContains('Please authenticate yourself to proceed', $result);
50
-	}
46
+        $this->assertNotRedirect();
47
+        $this->assertResponseStatusCode(Response::STATUS_CODE_401);
48
+        $this->assertContains('Please authenticate yourself to proceed', $result);
49
+    }
51 50
 	
52
-	public function testAccessWhenLoggedIn()
53
-	{
54
-		$this->authenticateUser();
55
-		$this->dispatch(self::URL_MY_PROFILE,Request::METHOD_GET);
56
-		$result = $this->getResponse()->getContent();
57
-		$this->assertNotRedirect();
58
-		$this->assertResponseStatusCode(Response::STATUS_CODE_200);
59
-		$this->assertContains('My profile - YAWIK', $result);
60
-	}
51
+    public function testAccessWhenLoggedIn()
52
+    {
53
+        $this->authenticateUser();
54
+        $this->dispatch(self::URL_MY_PROFILE,Request::METHOD_GET);
55
+        $result = $this->getResponse()->getContent();
56
+        $this->assertNotRedirect();
57
+        $this->assertResponseStatusCode(Response::STATUS_CODE_200);
58
+        $this->assertContains('My profile - YAWIK', $result);
59
+    }
61 60
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 			->disableOriginalConstructor()
36 36
 			->getMock()
37 37
 		;
38
-		$this->setMockToServiceLocator('HybridAuthAdapter',$this->hybridAuthAdapter);
38
+		$this->setMockToServiceLocator('HybridAuthAdapter', $this->hybridAuthAdapter);
39 39
 	}
40 40
 	
41 41
 	public function testAccessWhenNotLoggedIn()
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	public function testAccessWhenLoggedIn()
53 53
 	{
54 54
 		$this->authenticateUser();
55
-		$this->dispatch(self::URL_MY_PROFILE,Request::METHOD_GET);
55
+		$this->dispatch(self::URL_MY_PROFILE, Request::METHOD_GET);
56 56
 		$result = $this->getResponse()->getContent();
57 57
 		$this->assertNotRedirect();
58 58
 		$this->assertResponseStatusCode(Response::STATUS_CODE_200);
Please login to merge, or discard this patch.
module/Auth/test/AuthTest/Controller/RemoveControllerTest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
         
126 126
         $pluginManager = $this->controller->getPluginManager();
127 127
         $pluginManager->setService('redirect', $redirect);
128
-		$pluginManager->setService('params', $params);
128
+        $pluginManager->setService('params', $params);
129 129
         
130 130
         $user = $this->getMockBuilder(User::class)
131 131
             ->getMock();
Please login to merge, or discard this patch.