@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | private $target = [ |
37 | 37 | ImageSetHydratorFactory::class, |
38 | 38 | '@testCreateService' => [ |
39 | - 'mock' => [ |
|
40 | - '__invoke' => [ |
|
41 | - '@with' => 'getInvocationArgs', |
|
42 | - 'count' => 1 |
|
43 | - ] |
|
44 | - ] |
|
39 | + 'mock' => [ |
|
40 | + '__invoke' => [ |
|
41 | + '@with' => 'getInvocationArgs', |
|
42 | + 'count' => 1 |
|
43 | + ] |
|
44 | + ] |
|
45 | 45 | ], |
46 | 46 | ]; |
47 | 47 | |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | |
58 | 58 | public function testCreateService() |
59 | 59 | { |
60 | - $container = $this->getServiceManagerMock(); |
|
61 | - $pluginManager = $this->getPluginManagerMock(); |
|
60 | + $container = $this->getServiceManagerMock(); |
|
61 | + $pluginManager = $this->getPluginManagerMock(); |
|
62 | 62 | $this->target->createService($container,$pluginManager); |
63 | 63 | } |
64 | 64 |
@@ -160,7 +160,7 @@ |
||
160 | 160 | |
161 | 161 | $set = $this->getMockBuilder(ImageSet::class)->setMethods(['setImages'])->getMock(); |
162 | 162 | $set->expects($this->once())->method('setImages')->with( |
163 | - ['original' => $entityMock, 'thumbnail' => $entityMock, 'small' => $entityMock] |
|
163 | + ['original' => $entityMock, 'thumbnail' => $entityMock, 'small' => $entityMock] |
|
164 | 164 | )->will($this->returnSelf()); |
165 | 165 | |
166 | 166 | $actual = $this->target->hydrate($data, $set); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | public function testCloneCreatesNewResourceCollection() |
63 | 63 | { |
64 | 64 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
65 | - ->getMockForAbstractClass(); |
|
65 | + ->getMockForAbstractClass(); |
|
66 | 66 | |
67 | 67 | $target1 = new Permissions(); |
68 | 68 | $target1->grant($resource, Permissions::PERMISSION_ALL); |
@@ -119,23 +119,23 @@ discard block |
||
119 | 119 | $allParams = array($user, PermissionsInterface::PERMISSION_ALL); |
120 | 120 | |
121 | 121 | $target = $this->getMockBuilder('\Core\Entity\Permissions')->disableOriginalConstructor() |
122 | - ->setMethods(array('isGranted', 'grant', 'revoke'))->getMock(); |
|
122 | + ->setMethods(array('isGranted', 'grant', 'revoke'))->getMock(); |
|
123 | 123 | |
124 | 124 | |
125 | 125 | $target->expects($this->exactly(4)) |
126 | - ->method('isGranted') |
|
127 | - ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
128 | - ->willReturn(null); |
|
126 | + ->method('isGranted') |
|
127 | + ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
128 | + ->willReturn(null); |
|
129 | 129 | |
130 | 130 | $target->expects($this->exactly(4)) |
131 | - ->method('grant') |
|
132 | - ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
133 | - ->willReturn(null); |
|
131 | + ->method('grant') |
|
132 | + ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
133 | + ->willReturn(null); |
|
134 | 134 | |
135 | 135 | $target->expects($this->exactly(4)) |
136 | - ->method('revoke') |
|
137 | - ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
138 | - ->willReturn(null); |
|
136 | + ->method('revoke') |
|
137 | + ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
138 | + ->willReturn(null); |
|
139 | 139 | |
140 | 140 | /* Test starts here */ |
141 | 141 | |
@@ -165,11 +165,11 @@ discard block |
||
165 | 165 | $target = new Permissions(); |
166 | 166 | |
167 | 167 | foreach (array( |
168 | - PermissionsInterface::PERMISSION_VIEW => array(true, false, false, false), |
|
169 | - PermissionsInterface::PERMISSION_CHANGE => array(true, true, true, false), |
|
170 | - PermissionsInterface::PERMISSION_ALL => array(true, true, true, false), |
|
171 | - PermissionsInterface::PERMISSION_NONE => array(false, false, false, true), |
|
172 | - ) as $perm => $expected |
|
168 | + PermissionsInterface::PERMISSION_VIEW => array(true, false, false, false), |
|
169 | + PermissionsInterface::PERMISSION_CHANGE => array(true, true, true, false), |
|
170 | + PermissionsInterface::PERMISSION_ALL => array(true, true, true, false), |
|
171 | + PermissionsInterface::PERMISSION_NONE => array(false, false, false, true), |
|
172 | + ) as $perm => $expected |
|
173 | 173 | ) { |
174 | 174 | |
175 | 175 | $target->grant($resource, $perm); |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $target->grant($resource, PermissionsInterface::PERMISSION_VIEW, false); |
276 | 276 | |
277 | 277 | $this->assertFalse($target->isGranted($user1, PermissionsInterface::PERMISSION_VIEW), |
278 | - 'Disable build of permissions test failed!'); |
|
278 | + 'Disable build of permissions test failed!'); |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
@@ -300,17 +300,17 @@ discard block |
||
300 | 300 | public function testGrantWorksWhenPassingPermissionsResourceInterfaces() |
301 | 301 | { |
302 | 302 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
303 | - ->getMockForAbstractClass(); |
|
303 | + ->getMockForAbstractClass(); |
|
304 | 304 | |
305 | 305 | $resource->expects($this->any()) |
306 | - ->method('getPermissionsResourceId')->willReturn('resource'); |
|
306 | + ->method('getPermissionsResourceId')->willReturn('resource'); |
|
307 | 307 | |
308 | 308 | $userIds1 = array('user1', 'user2'); |
309 | 309 | $userIds2 = array('view' => array('user1', 'user2'), 'all' => array('user3', 'user4')); |
310 | 310 | $resource->expects($this->exactly(4)) |
311 | - ->method('getPermissionsUserIds') |
|
312 | - ->will($this->onConsecutiveCalls( |
|
313 | - $userIds1, $userIds2, array(), null |
|
311 | + ->method('getPermissionsUserIds') |
|
312 | + ->will($this->onConsecutiveCalls( |
|
313 | + $userIds1, $userIds2, array(), null |
|
314 | 314 | )); |
315 | 315 | |
316 | 316 | |
@@ -378,9 +378,9 @@ discard block |
||
378 | 378 | |
379 | 379 | /* @var $target \Core\Entity\PermissionsInterface|\PHPUnit_Framework_MockObject_MockObject */ |
380 | 380 | $target = $this->getMockBuilder('\Core\Entity\Permissions') |
381 | - ->disableOriginalConstructor() |
|
382 | - ->setMethods(array('grant', 'isAssigned')) |
|
383 | - ->getMock(); |
|
381 | + ->disableOriginalConstructor() |
|
382 | + ->setMethods(array('grant', 'isAssigned')) |
|
383 | + ->getMock(); |
|
384 | 384 | |
385 | 385 | if (PermissionsInterface::PERMISSION_NONE == $perm) { |
386 | 386 | $target->expects($this->never())->method('isAssigned'); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | : PermissionsInterface::PERMISSION_NONE; |
396 | 396 | |
397 | 397 | $target->expects($this->once())->method('grant')->with($resource, $expPerm, $build) |
398 | - ->will($this->returnSelf()); |
|
398 | + ->will($this->returnSelf()); |
|
399 | 399 | } |
400 | 400 | |
401 | 401 | /* Test start here */ |
@@ -451,11 +451,11 @@ discard block |
||
451 | 451 | } |
452 | 452 | |
453 | 453 | foreach (array( |
454 | - PermissionsInterface::PERMISSION_NONE, |
|
455 | - PermissionsInterface::PERMISSION_VIEW, |
|
456 | - PermissionsInterface::PERMISSION_CHANGE, |
|
457 | - PermissionsInterface::PERMISSION_ALL |
|
458 | - ) as $i => $perm |
|
454 | + PermissionsInterface::PERMISSION_NONE, |
|
455 | + PermissionsInterface::PERMISSION_VIEW, |
|
456 | + PermissionsInterface::PERMISSION_CHANGE, |
|
457 | + PermissionsInterface::PERMISSION_ALL |
|
458 | + ) as $i => $perm |
|
459 | 459 | ) { |
460 | 460 | $this->assertEquals($expected[$i], $target->isGranted($user, $perm)); |
461 | 461 | } |
@@ -472,13 +472,13 @@ discard block |
||
472 | 472 | public function testClear() |
473 | 473 | { |
474 | 474 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
475 | - ->getMockForAbstractClass(); |
|
475 | + ->getMockForAbstractClass(); |
|
476 | 476 | |
477 | 477 | $resource->expects($this->any()) |
478 | - ->method('getPermissionsResourceId')->willReturn('resource'); |
|
478 | + ->method('getPermissionsResourceId')->willReturn('resource'); |
|
479 | 479 | |
480 | 480 | $resource->expects($this->exactly(1))->method('getPermissionsUserIds') |
481 | - ->willReturn(array('test')); |
|
481 | + ->willReturn(array('test')); |
|
482 | 482 | |
483 | 483 | $target = new Permissions(); |
484 | 484 | $target->grant('test', Permissions::PERMISSION_ALL); |
@@ -513,13 +513,13 @@ discard block |
||
513 | 513 | { |
514 | 514 | |
515 | 515 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
516 | - ->getMockForAbstractClass(); |
|
516 | + ->getMockForAbstractClass(); |
|
517 | 517 | |
518 | 518 | $resource->expects($this->any()) |
519 | - ->method('getPermissionsResourceId')->willReturn('resource'); |
|
519 | + ->method('getPermissionsResourceId')->willReturn('resource'); |
|
520 | 520 | |
521 | 521 | $resource->expects($this->any())->method('getPermissionsUserIds') |
522 | - ->willReturn(array('test')); |
|
522 | + ->willReturn(array('test')); |
|
523 | 523 | |
524 | 524 | $target1 = new Permissions(); |
525 | 525 | $target2 = new Permissions(); |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | public function testGetResourcesReturnsCollectionOfResources() |
618 | 618 | { |
619 | 619 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
620 | - ->getMockForAbstractClass(); |
|
620 | + ->getMockForAbstractClass(); |
|
621 | 621 | |
622 | 622 | $target = new Permissions(); |
623 | 623 | $target->grant($resource, PermissionsInterface::PERMISSION_ALL); |
@@ -640,13 +640,13 @@ discard block |
||
640 | 640 | $grantedResource->expects($this->atLeastOnce()) |
641 | 641 | ->method('getPermissionsUserIds') |
642 | 642 | ->will($this->onConsecutiveCalls(array( |
643 | - 'all' => array('user1', 'user2'), |
|
644 | - 'view' => array('popel', 'dopel'), |
|
645 | - ), array('all' => array('user3')))); |
|
643 | + 'all' => array('user1', 'user2'), |
|
644 | + 'view' => array('popel', 'dopel'), |
|
645 | + ), array('all' => array('user3')))); |
|
646 | 646 | $grantedResource->method('getPermissionsResourceId')->willReturn('grantResource'); |
647 | 647 | |
648 | 648 | $ungrantedResource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
649 | - ->getMockForAbstractClass(); |
|
649 | + ->getMockForAbstractClass(); |
|
650 | 650 | $ungrantedResource->method('getPermissionsResourceId')->willReturn('ungrant'); |
651 | 651 | |
652 | 652 | $target = new Permissions(); |
@@ -120,9 +120,9 @@ |
||
120 | 120 | public function testHasPropertyReturnsExpectedResults($target, $expects) |
121 | 121 | { |
122 | 122 | $modes = [EntityInterface::PROPERTY_FACILE, |
123 | - EntityInterface::PROPERTY_GETTER, |
|
124 | - EntityInterface::PROPERTY_SETTER, |
|
125 | - EntityInterface::PROPERTY_STRICT]; |
|
123 | + EntityInterface::PROPERTY_GETTER, |
|
124 | + EntityInterface::PROPERTY_SETTER, |
|
125 | + EntityInterface::PROPERTY_STRICT]; |
|
126 | 126 | |
127 | 127 | foreach ($modes as $mode) { |
128 | 128 |
@@ -124,18 +124,18 @@ |
||
124 | 124 | private function getPreparedTarget() |
125 | 125 | { |
126 | 126 | return new FieldsetCustomizationOptions([ |
127 | - 'fields' => [ |
|
128 | - 'field' => [ |
|
129 | - 'attributes' => ['attr' => 'attrVal'], |
|
130 | - 'options' => ['opt1' => 'optVal' ], |
|
131 | - 'label' => 'label', |
|
132 | - 'required' => true, |
|
133 | - 'type' => 'ElementType', |
|
134 | - 'priority' => 12, |
|
135 | - 'flags' => ['priority' => 10], |
|
136 | - 'input_filter' => ['test' => 'works'], |
|
137 | - ], |
|
138 | - ], |
|
127 | + 'fields' => [ |
|
128 | + 'field' => [ |
|
129 | + 'attributes' => ['attr' => 'attrVal'], |
|
130 | + 'options' => ['opt1' => 'optVal' ], |
|
131 | + 'label' => 'label', |
|
132 | + 'required' => true, |
|
133 | + 'type' => 'ElementType', |
|
134 | + 'priority' => 12, |
|
135 | + 'flags' => ['priority' => 10], |
|
136 | + 'input_filter' => ['test' => 'works'], |
|
137 | + ], |
|
138 | + ], |
|
139 | 139 | ]); |
140 | 140 | } |
141 | 141 |
@@ -104,8 +104,8 @@ |
||
104 | 104 | public function testGetSiteNameThrowsExceptionIfNotSet() |
105 | 105 | { |
106 | 106 | $this->setExpectedException( |
107 | - '\Core\Options\Exception\MissingOptionException', |
|
108 | - 'Missing value for option "siteName"' |
|
107 | + '\Core\Options\Exception\MissingOptionException', |
|
108 | + 'Missing value for option "siteName"' |
|
109 | 109 | ); |
110 | 110 | |
111 | 111 | $this->target->setSiteName(''); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | } |
85 | 85 | |
86 | 86 | public function testDisableElement() { |
87 | - /* @todo */ |
|
87 | + /* @todo */ |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | foreach ($classes as $class) { |
119 | 119 | $this->target->addClass($class); |
120 | 120 | } |
121 | - }elseif (is_string($classes)){ |
|
121 | + }elseif (is_string($classes)){ |
|
122 | 122 | $this->target->addClass($classes); |
123 | - } |
|
123 | + } |
|
124 | 124 | |
125 | 125 | $x=$this->target->getAttribute('class'); |
126 | 126 | $this->assertEquals($x, $expected); |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | * @param string $expected render mode |
41 | 41 | */ |
42 | 42 | public function testSetGetRenderModer($input,$expected) { |
43 | - $this->target->setRenderMode($input); |
|
44 | - $this->assertSame($this->target->getRenderMode(),$expected); |
|
43 | + $this->target->setRenderMode($input); |
|
44 | + $this->assertSame($this->target->getRenderMode(),$expected); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function providerRenderMode() |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | public function testIsValid(){ |
78 | - /* @todo */ |
|
78 | + /* @todo */ |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -49,8 +49,8 @@ discard block |
||
49 | 49 | { |
50 | 50 | $expect = ['extract' => 'works']; |
51 | 51 | $object = $this->getMockBuilder(MetaDataProviderInterface::class) |
52 | - ->setMethods(['getMetaData']) |
|
53 | - ->getMockForAbstractClass(); |
|
52 | + ->setMethods(['getMetaData']) |
|
53 | + ->getMockForAbstractClass(); |
|
54 | 54 | |
55 | 55 | $object->expects($this->once())->method('getMetaData')->willReturn($expect); |
56 | 56 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | public function testHydrationOfMetaDataProvider() |
70 | 70 | { |
71 | 71 | $object = $this->getMockBuilder(MetaDataProviderInterface::class) |
72 | - ->setMethods(['setMetaData']) |
|
73 | - ->getMockForAbstractClass(); |
|
72 | + ->setMethods(['setMetaData']) |
|
73 | + ->getMockForAbstractClass(); |
|
74 | 74 | |
75 | 75 | $object->expects($this->once())->method('setMetaData')->with('key', 'value'); |
76 | 76 |