@@ -122,9 +122,9 @@ |
||
| 122 | 122 | public function testHasPropertyReturnsExpectedResults($target, $expects) |
| 123 | 123 | { |
| 124 | 124 | $modes = [EntityInterface::PROPERTY_FACILE, |
| 125 | - EntityInterface::PROPERTY_GETTER, |
|
| 126 | - EntityInterface::PROPERTY_SETTER, |
|
| 127 | - EntityInterface::PROPERTY_STRICT]; |
|
| 125 | + EntityInterface::PROPERTY_GETTER, |
|
| 126 | + EntityInterface::PROPERTY_SETTER, |
|
| 127 | + EntityInterface::PROPERTY_STRICT]; |
|
| 128 | 128 | |
| 129 | 129 | foreach ($modes as $mode) { |
| 130 | 130 | $actual = $target->hasProperty('testProperty', $mode); |
@@ -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(); |
@@ -51,19 +51,19 @@ |
||
| 51 | 51 | { |
| 52 | 52 | $mock = $this->getMockBuilder(AddItemFieldset::class) |
| 53 | 53 | ->setMethods(['setObject', 'add']) |
| 54 | - ->disableOriginalConstructor()->getMock(); |
|
| 54 | + ->disableOriginalConstructor()->getMock(); |
|
| 55 | 55 | |
| 56 | 56 | $mock->expects($this->once())->method('setObject')->with($this->isInstanceOf(\ArrayObject::class)); |
| 57 | 57 | |
| 58 | 58 | $mock->expects($this->exactly(6))->method('add') |
| 59 | - ->withConsecutive( |
|
| 60 | - [['name' => 'id', 'type' => 'Hidden']], |
|
| 61 | - [['name' => 'current', 'type' => 'Hidden']], |
|
| 62 | - [['name' => 'do', 'type' => 'Hidden']], |
|
| 63 | - [['name' => 'name', 'type' => 'Text', 'options' => ['label' => 'Name'], 'attributes' => ['required' => 'required']]], |
|
| 64 | - [['name' => 'value', 'type' => 'Text', 'options' => ['label' => 'Value']]], |
|
| 65 | - [['name' => 'priority', 'type' => 'Text']] |
|
| 66 | - ); |
|
| 59 | + ->withConsecutive( |
|
| 60 | + [['name' => 'id', 'type' => 'Hidden']], |
|
| 61 | + [['name' => 'current', 'type' => 'Hidden']], |
|
| 62 | + [['name' => 'do', 'type' => 'Hidden']], |
|
| 63 | + [['name' => 'name', 'type' => 'Text', 'options' => ['label' => 'Name'], 'attributes' => ['required' => 'required']]], |
|
| 64 | + [['name' => 'value', 'type' => 'Text', 'options' => ['label' => 'Value']]], |
|
| 65 | + [['name' => 'priority', 'type' => 'Text']] |
|
| 66 | + ); |
|
| 67 | 67 | |
| 68 | 68 | return $mock; |
| 69 | 69 | } |
@@ -146,7 +146,7 @@ |
||
| 146 | 146 | |
| 147 | 147 | $this->assertEquals( |
| 148 | 148 | ['test' => ['required' => true], |
| 149 | - 'test2' => ['filters' => []]], |
|
| 149 | + 'test2' => ['filters' => []]], |
|
| 150 | 150 | $actual |
| 151 | 151 | ); |
| 152 | 152 | } |
@@ -282,10 +282,10 @@ |
||
| 282 | 282 | 'return' => isset($methodSpec['@return']) |
| 283 | 283 | ? $call((array) $methodSpec['@return']) |
| 284 | 284 | : ( |
| 285 | - isset($methodSpec['return']) |
|
| 285 | + isset($methodSpec['return']) |
|
| 286 | 286 | ? ('__self__' === $methodSpec['return'] ? $this->returnSelf() : $this->returnValue($methodSpec['return'])) |
| 287 | 287 | : null |
| 288 | - ), |
|
| 288 | + ), |
|
| 289 | 289 | ]; |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $errTmpl = __METHOD__ . ': ' . get_class($this); |
| 186 | 186 | if (!property_exists($this, 'target') || (!is_object($this->target) && !isset($spec['target']))) { |
| 187 | 187 | throw new PHPUnitException($errTmpl |
| 188 | - . ' must define the property "target" and the value must be an object.'); |
|
| 188 | + . ' must define the property "target" and the value must be an object.'); |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | if (!is_array($spec)) { |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | } |
| 400 | 400 | |
| 401 | 401 | $err = __TRAIT__ . ': ' . get_class($this) . ': Setter ' . get_class($this->target) . '::' . $setter |
| 402 | - . ($expect === $this->target ? ' breaks fluent interface.' : ' does not return expected value.'); |
|
| 402 | + . ($expect === $this->target ? ' breaks fluent interface.' : ' does not return expected value.'); |
|
| 403 | 403 | |
| 404 | 404 | |
| 405 | 405 | if (false === $args) { |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | protected function setUp(): void |
| 35 | 35 | { |
| 36 | 36 | $this->target = $this->getMockBuilder('\Jobs\Form\CompanyNameFieldset') |
| 37 | - ->disableOriginalConstructor() |
|
| 38 | - ->setMethods(array('setAttribute', 'setName', 'add')) |
|
| 39 | - ->getMock(); |
|
| 37 | + ->disableOriginalConstructor() |
|
| 38 | + ->setMethods(array('setAttribute', 'setName', 'add')) |
|
| 39 | + ->getMock(); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | /** |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | public function testInitialization() |
| 54 | 54 | { |
| 55 | 55 | $this->target->expects($this->once()) |
| 56 | - ->method('setAttribute') |
|
| 57 | - ->with('id', 'jobcompanyname-fieldset'); |
|
| 56 | + ->method('setAttribute') |
|
| 57 | + ->with('id', 'jobcompanyname-fieldset'); |
|
| 58 | 58 | |
| 59 | 59 | $this->target->expects($this->once()) |
| 60 | - ->method('setName') |
|
| 61 | - ->with('jobCompanyName'); |
|
| 60 | + ->method('setName') |
|
| 61 | + ->with('jobCompanyName'); |
|
| 62 | 62 | |
| 63 | 63 | $addParam1 = array( |
| 64 | 64 | 'type' => 'Jobs/HiringOrganizationSelect', |
@@ -93,10 +93,10 @@ discard block |
||
| 93 | 93 | ]; |
| 94 | 94 | |
| 95 | 95 | $this->target->expects($this->exactly(2)) |
| 96 | - ->method('add') |
|
| 97 | - ->withConsecutive( |
|
| 98 | - [$addParam1], |
|
| 99 | - [$addParam2] |
|
| 96 | + ->method('add') |
|
| 97 | + ->withConsecutive( |
|
| 98 | + [$addParam1], |
|
| 99 | + [$addParam2] |
|
| 100 | 100 | ); |
| 101 | 101 | |
| 102 | 102 | $this->target->init(); |
@@ -71,12 +71,12 @@ discard block |
||
| 71 | 71 | ->getMock(); |
| 72 | 72 | |
| 73 | 73 | $this->loginFilterMock = $this->getMockBuilder('Auth\Filter\LoginFilter') |
| 74 | - ->disableOriginalConstructor() |
|
| 75 | - ->getMock(); |
|
| 74 | + ->disableOriginalConstructor() |
|
| 75 | + ->getMock(); |
|
| 76 | 76 | |
| 77 | 77 | $this->optionsMock = $this->getMockBuilder('Auth\Options\ModuleOptions') |
| 78 | - ->disableOriginalConstructor() |
|
| 79 | - ->getMock(); |
|
| 78 | + ->disableOriginalConstructor() |
|
| 79 | + ->getMock(); |
|
| 80 | 80 | |
| 81 | 81 | $this->testedObject = new ForgotPassword($this->userRepositoryMock, $this->tokenGeneratorMock, $this->loginFilterMock, $this->optionsMock); |
| 82 | 82 | |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /** |
| 152 | - * @todo fix or delete |
|
| 153 | - */ |
|
| 152 | + * @todo fix or delete |
|
| 153 | + */ |
|
| 154 | 154 | /* |
| 155 | 155 | public function testProceed() |
| 156 | 156 | { |
@@ -43,10 +43,10 @@ |
||
| 43 | 43 | |
| 44 | 44 | protected function setUp(): void |
| 45 | 45 | { |
| 46 | - $events = $this->getMockBuilder(EventManager::class) |
|
| 47 | - ->setMethods(['getEvent', 'triggerEvent']) |
|
| 48 | - ->getMock(); |
|
| 49 | - $this->target = new AdminController($events); |
|
| 46 | + $events = $this->getMockBuilder(EventManager::class) |
|
| 47 | + ->setMethods(['getEvent', 'triggerEvent']) |
|
| 48 | + ->getMock(); |
|
| 49 | + $this->target = new AdminController($events); |
|
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function testIndexAction() |