@@ -41,7 +41,7 @@ |
||
| 41 | 41 | '@testConstruct' => false, |
| 42 | 42 | ]; |
| 43 | 43 | |
| 44 | - private $inheritance = [ EntityHydrator::class ]; |
|
| 44 | + private $inheritance = [EntityHydrator::class]; |
|
| 45 | 45 | |
| 46 | 46 | private $properties = [ |
| 47 | 47 | ['propertyMap', ['default' => [], 'value' => ['property' => 'fieldname']]] |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public function providerCreateDate() |
| 44 | 44 | { |
| 45 | 45 | return [ |
| 46 | - [ new \DateTime("2010-11-12"), new \DateTime("2010-11-12")], |
|
| 46 | + [new \DateTime("2010-11-12"), new \DateTime("2010-11-12")], |
|
| 47 | 47 | ]; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -68,8 +68,8 @@ discard block |
||
| 68 | 68 | $timezone = getenv('TIMEZONE'); |
| 69 | 69 | $timezone = new \DateTimeZone($timezone); |
| 70 | 70 | return [ |
| 71 | - [ new \DateTime("2010-11-12"), new \DateTime("2010-11-12", $timezone)], |
|
| 72 | - [ "2011-12-13" , new \DateTime("2011-12-13", $timezone)] |
|
| 71 | + [new \DateTime("2010-11-12"), new \DateTime("2010-11-12", $timezone)], |
|
| 72 | + ["2011-12-13", new \DateTime("2011-12-13", $timezone)] |
|
| 73 | 73 | ]; |
| 74 | 74 | } |
| 75 | 75 | |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | ], |
| 36 | 36 | ]; |
| 37 | 37 | |
| 38 | - private $inheritance = [ AbstractStatus::class ]; |
|
| 38 | + private $inheritance = [AbstractStatus::class]; |
|
| 39 | 39 | |
| 40 | 40 | public function xtestGetStatesSortsMap() |
| 41 | 41 | { |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | private $target = [ |
| 36 | 36 | Ast_ConcreteStatus::class, |
| 37 | - [ Ast_ConcreteStatus::TEST ], |
|
| 37 | + [Ast_ConcreteStatus::TEST], |
|
| 38 | 38 | '@testInheritance' => [ |
| 39 | 39 | 'class' => AbstractStatus::class, |
| 40 | 40 | 'as_reflection' => true |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | '@testConstruction' => false, |
| 45 | 45 | ]; |
| 46 | 46 | |
| 47 | - private $inheritance = [ StatusInterface::class ]; |
|
| 47 | + private $inheritance = [StatusInterface::class]; |
|
| 48 | 48 | |
| 49 | 49 | public function testGetStates() |
| 50 | 50 | { |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | ->getMock(); |
| 92 | 92 | $attachableEntityManager->expects($this->once()) |
| 93 | 93 | ->method('setReferences') |
| 94 | - ->with($this->callback(function ($references) { |
|
| 94 | + ->with($this->callback(function($references) { |
|
| 95 | 95 | return is_array($references); |
| 96 | 96 | })) |
| 97 | 97 | ->willReturnSelf(); |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | '@testSetImagesWithPermissions' => ['mock' => ['clear' => 1, 'set' => 0, 'setPermissions']], |
| 44 | 44 | ]; |
| 45 | 45 | |
| 46 | - private $inheritance = [ ImageSetInterface::class ]; |
|
| 46 | + private $inheritance = [ImageSetInterface::class]; |
|
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * @covers ::__construct |
@@ -206,8 +206,8 @@ |
||
| 206 | 206 | public function provideTestCreateAttachedEntityData() |
| 207 | 207 | { |
| 208 | 208 | return [ |
| 209 | - ['EntityClass' ], |
|
| 210 | - ['EntityClass', 'testkey' ], |
|
| 209 | + ['EntityClass'], |
|
| 210 | + ['EntityClass', 'testkey'], |
|
| 211 | 211 | ['EntityClass', ['param' => 'value']], |
| 212 | 212 | ['EntityClass', ['param' => 'value'], 'testkey'], |
| 213 | 213 | ]; |
@@ -183,14 +183,14 @@ |
||
| 183 | 183 | public function provideRolePermissionsData() |
| 184 | 184 | { |
| 185 | 185 | return [ |
| 186 | - [ 'user', 'user', false, true ], |
|
| 187 | - [ 'recruiter', 'user', false, false ], |
|
| 188 | - [ 'all', 'irrelevant', false, true ], |
|
| 189 | - [ 'user', 'user', true, true ], |
|
| 190 | - [ 'recruiter', 'user', true, false], |
|
| 191 | - [ 'all', 'irrelevant', true, true ], |
|
| 192 | - [ 'testUser', null, true, true ], |
|
| 193 | - [ 'anonymous', null, true, false ], |
|
| 186 | + ['user', 'user', false, true], |
|
| 187 | + ['recruiter', 'user', false, false], |
|
| 188 | + ['all', 'irrelevant', false, true], |
|
| 189 | + ['user', 'user', true, true], |
|
| 190 | + ['recruiter', 'user', true, false], |
|
| 191 | + ['all', 'irrelevant', true, true], |
|
| 192 | + ['testUser', null, true, true], |
|
| 193 | + ['anonymous', null, true, false], |
|
| 194 | 194 | ]; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | public function testCloneCreatesNewResourceCollection() |
| 65 | 65 | { |
| 66 | 66 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
| 67 | - ->getMockForAbstractClass(); |
|
| 67 | + ->getMockForAbstractClass(); |
|
| 68 | 68 | |
| 69 | 69 | $target1 = new Permissions(); |
| 70 | 70 | $target1->grant($resource, Permissions::PERMISSION_ALL); |
@@ -121,23 +121,23 @@ discard block |
||
| 121 | 121 | $allParams = array($user, PermissionsInterface::PERMISSION_ALL); |
| 122 | 122 | |
| 123 | 123 | $target = $this->getMockBuilder('\Core\Entity\Permissions')->disableOriginalConstructor() |
| 124 | - ->setMethods(array('isGranted', 'grant', 'revoke'))->getMock(); |
|
| 124 | + ->setMethods(array('isGranted', 'grant', 'revoke'))->getMock(); |
|
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | $target->expects($this->exactly(4)) |
| 128 | - ->method('isGranted') |
|
| 129 | - ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
| 130 | - ->willReturn(null); |
|
| 128 | + ->method('isGranted') |
|
| 129 | + ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
| 130 | + ->willReturn(null); |
|
| 131 | 131 | |
| 132 | 132 | $target->expects($this->exactly(4)) |
| 133 | - ->method('grant') |
|
| 134 | - ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
| 135 | - ->willReturn(null); |
|
| 133 | + ->method('grant') |
|
| 134 | + ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
| 135 | + ->willReturn(null); |
|
| 136 | 136 | |
| 137 | 137 | $target->expects($this->exactly(4)) |
| 138 | - ->method('revoke') |
|
| 139 | - ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
| 140 | - ->willReturn(null); |
|
| 138 | + ->method('revoke') |
|
| 139 | + ->withConsecutive($viewParams, $changeParams, $noneParams, $allParams) |
|
| 140 | + ->willReturn(null); |
|
| 141 | 141 | |
| 142 | 142 | /* Test starts here */ |
| 143 | 143 | |
@@ -167,11 +167,11 @@ discard block |
||
| 167 | 167 | $target = new Permissions(); |
| 168 | 168 | |
| 169 | 169 | foreach (array( |
| 170 | - PermissionsInterface::PERMISSION_VIEW => array(true, false, false, false), |
|
| 171 | - PermissionsInterface::PERMISSION_CHANGE => array(true, true, true, false), |
|
| 172 | - PermissionsInterface::PERMISSION_ALL => array(true, true, true, false), |
|
| 173 | - PermissionsInterface::PERMISSION_NONE => array(false, false, false, true), |
|
| 174 | - ) as $perm => $expected |
|
| 170 | + PermissionsInterface::PERMISSION_VIEW => array(true, false, false, false), |
|
| 171 | + PermissionsInterface::PERMISSION_CHANGE => array(true, true, true, false), |
|
| 172 | + PermissionsInterface::PERMISSION_ALL => array(true, true, true, false), |
|
| 173 | + PermissionsInterface::PERMISSION_NONE => array(false, false, false, true), |
|
| 174 | + ) as $perm => $expected |
|
| 175 | 175 | ) { |
| 176 | 176 | $target->grant($resource, $perm); |
| 177 | 177 | $this->assertEquals($expected[0], $target->isGranted($resource, PermissionsInterface::PERMISSION_VIEW)); |
@@ -302,20 +302,20 @@ discard block |
||
| 302 | 302 | public function testGrantWorksWhenPassingPermissionsResourceInterfaces() |
| 303 | 303 | { |
| 304 | 304 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
| 305 | - ->getMockForAbstractClass(); |
|
| 305 | + ->getMockForAbstractClass(); |
|
| 306 | 306 | |
| 307 | 307 | $resource->expects($this->any()) |
| 308 | - ->method('getPermissionsResourceId')->willReturn('resource'); |
|
| 308 | + ->method('getPermissionsResourceId')->willReturn('resource'); |
|
| 309 | 309 | |
| 310 | 310 | $userIds1 = array('user1', 'user2'); |
| 311 | 311 | $userIds2 = array('view' => array('user1', 'user2'), 'all' => array('user3', 'user4')); |
| 312 | 312 | $resource->expects($this->exactly(4)) |
| 313 | - ->method('getPermissionsUserIds') |
|
| 314 | - ->will($this->onConsecutiveCalls( |
|
| 315 | - $userIds1, |
|
| 316 | - $userIds2, |
|
| 317 | - array(), |
|
| 318 | - null |
|
| 313 | + ->method('getPermissionsUserIds') |
|
| 314 | + ->will($this->onConsecutiveCalls( |
|
| 315 | + $userIds1, |
|
| 316 | + $userIds2, |
|
| 317 | + array(), |
|
| 318 | + null |
|
| 319 | 319 | )); |
| 320 | 320 | |
| 321 | 321 | |
@@ -383,9 +383,9 @@ discard block |
||
| 383 | 383 | |
| 384 | 384 | /* @var $target \Core\Entity\PermissionsInterface|\PHPUnit_Framework_MockObject_MockObject */ |
| 385 | 385 | $target = $this->getMockBuilder('\Core\Entity\Permissions') |
| 386 | - ->disableOriginalConstructor() |
|
| 387 | - ->setMethods(array('grant', 'isAssigned')) |
|
| 388 | - ->getMock(); |
|
| 386 | + ->disableOriginalConstructor() |
|
| 387 | + ->setMethods(array('grant', 'isAssigned')) |
|
| 388 | + ->getMock(); |
|
| 389 | 389 | |
| 390 | 390 | if (PermissionsInterface::PERMISSION_NONE == $perm) { |
| 391 | 391 | $target->expects($this->never())->method('isAssigned'); |
@@ -400,7 +400,7 @@ discard block |
||
| 400 | 400 | : PermissionsInterface::PERMISSION_NONE; |
| 401 | 401 | |
| 402 | 402 | $target->expects($this->once())->method('grant')->with($resource, $expPerm, $build) |
| 403 | - ->will($this->returnSelf()); |
|
| 403 | + ->will($this->returnSelf()); |
|
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | /* Test start here */ |
@@ -455,11 +455,11 @@ discard block |
||
| 455 | 455 | } |
| 456 | 456 | |
| 457 | 457 | foreach (array( |
| 458 | - PermissionsInterface::PERMISSION_NONE, |
|
| 459 | - PermissionsInterface::PERMISSION_VIEW, |
|
| 460 | - PermissionsInterface::PERMISSION_CHANGE, |
|
| 461 | - PermissionsInterface::PERMISSION_ALL |
|
| 462 | - ) as $i => $perm |
|
| 458 | + PermissionsInterface::PERMISSION_NONE, |
|
| 459 | + PermissionsInterface::PERMISSION_VIEW, |
|
| 460 | + PermissionsInterface::PERMISSION_CHANGE, |
|
| 461 | + PermissionsInterface::PERMISSION_ALL |
|
| 462 | + ) as $i => $perm |
|
| 463 | 463 | ) { |
| 464 | 464 | $this->assertEquals($expected[$i], $target->isGranted($user, $perm)); |
| 465 | 465 | } |
@@ -476,13 +476,13 @@ discard block |
||
| 476 | 476 | public function testClear() |
| 477 | 477 | { |
| 478 | 478 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
| 479 | - ->getMockForAbstractClass(); |
|
| 479 | + ->getMockForAbstractClass(); |
|
| 480 | 480 | |
| 481 | 481 | $resource->expects($this->any()) |
| 482 | - ->method('getPermissionsResourceId')->willReturn('resource'); |
|
| 482 | + ->method('getPermissionsResourceId')->willReturn('resource'); |
|
| 483 | 483 | |
| 484 | 484 | $resource->expects($this->exactly(1))->method('getPermissionsUserIds') |
| 485 | - ->willReturn(array('test')); |
|
| 485 | + ->willReturn(array('test')); |
|
| 486 | 486 | |
| 487 | 487 | $target = new Permissions(); |
| 488 | 488 | $target->grant('test', Permissions::PERMISSION_ALL); |
@@ -516,13 +516,13 @@ discard block |
||
| 516 | 516 | public function testInherit() |
| 517 | 517 | { |
| 518 | 518 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
| 519 | - ->getMockForAbstractClass(); |
|
| 519 | + ->getMockForAbstractClass(); |
|
| 520 | 520 | |
| 521 | 521 | $resource->expects($this->any()) |
| 522 | - ->method('getPermissionsResourceId')->willReturn('resource'); |
|
| 522 | + ->method('getPermissionsResourceId')->willReturn('resource'); |
|
| 523 | 523 | |
| 524 | 524 | $resource->expects($this->any())->method('getPermissionsUserIds') |
| 525 | - ->willReturn(array('test')); |
|
| 525 | + ->willReturn(array('test')); |
|
| 526 | 526 | |
| 527 | 527 | $target1 = new Permissions(); |
| 528 | 528 | $target2 = new Permissions(); |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | public function testGetResourcesReturnsCollectionOfResources() |
| 619 | 619 | { |
| 620 | 620 | $resource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
| 621 | - ->getMockForAbstractClass(); |
|
| 621 | + ->getMockForAbstractClass(); |
|
| 622 | 622 | |
| 623 | 623 | $target = new Permissions(); |
| 624 | 624 | $target->grant($resource, PermissionsInterface::PERMISSION_ALL); |
@@ -641,13 +641,13 @@ discard block |
||
| 641 | 641 | $grantedResource->expects($this->atLeastOnce()) |
| 642 | 642 | ->method('getPermissionsUserIds') |
| 643 | 643 | ->will($this->onConsecutiveCalls(array( |
| 644 | - 'all' => array('user1', 'user2'), |
|
| 645 | - 'view' => array('popel', 'dopel'), |
|
| 646 | - ), array('all' => array('user3')))); |
|
| 644 | + 'all' => array('user1', 'user2'), |
|
| 645 | + 'view' => array('popel', 'dopel'), |
|
| 646 | + ), array('all' => array('user3')))); |
|
| 647 | 647 | $grantedResource->method('getPermissionsResourceId')->willReturn('grantResource'); |
| 648 | 648 | |
| 649 | 649 | $ungrantedResource = $this->getMockBuilder('\Core\Entity\PermissionsResourceInterface') |
| 650 | - ->getMockForAbstractClass(); |
|
| 650 | + ->getMockForAbstractClass(); |
|
| 651 | 651 | $ungrantedResource->method('getPermissionsResourceId')->willReturn('ungrant'); |
| 652 | 652 | |
| 653 | 653 | $target = new Permissions(); |
@@ -47,15 +47,15 @@ |
||
| 47 | 47 | ] |
| 48 | 48 | ]; |
| 49 | 49 | |
| 50 | - private $inheritance = [ LeafsInterface::class ]; |
|
| 50 | + private $inheritance = [LeafsInterface::class]; |
|
| 51 | 51 | |
| 52 | - private $traits = [ EntityTrait::class ]; |
|
| 52 | + private $traits = [EntityTrait::class]; |
|
| 53 | 53 | |
| 54 | 54 | public function propertiesProvider() |
| 55 | 55 | { |
| 56 | 56 | |
| 57 | 57 | return [ |
| 58 | - [ 'items', ['default' => new ArrayCollection(), 'value' => new \Doctrine\Common\Collections\ArrayCollection()]], |
|
| 58 | + ['items', ['default' => new ArrayCollection(), 'value' => new \Doctrine\Common\Collections\ArrayCollection()]], |
|
| 59 | 59 | ]; |
| 60 | 60 | } |
| 61 | 61 | |