@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | |
118 | 118 | $orgRep = $this->getMockBuilder('\Organizations\Repository\Organization')->disableOriginalConstructor()->getMock(); |
119 | 119 | $orgRep->expects($this->exactly(2)) |
120 | - ->method('findByUser') |
|
121 | - ->withConsecutive(array('testOwner'), array('testUser')) |
|
122 | - ->will($this->onConsecutiveCalls($ownerOrg, $userOrg)); |
|
120 | + ->method('findByUser') |
|
121 | + ->withConsecutive(array('testOwner'), array('testUser')) |
|
122 | + ->will($this->onConsecutiveCalls($ownerOrg, $userOrg)); |
|
123 | 123 | |
124 | 124 | |
125 | 125 | $ownerOrgRef = new OrganizationReference('testOwner', $orgRep); |
@@ -136,25 +136,25 @@ discard block |
||
136 | 136 | |
137 | 137 | $router = $this->getMockForAbstractClass(RouteStackInterface::class); |
138 | 138 | $router->expects($this->once()) |
139 | - ->method('assemble') |
|
140 | - ->with( |
|
141 | - array('action' => 'accept'), |
|
142 | - array('name' => 'lang/organizations/invite', |
|
139 | + ->method('assemble') |
|
140 | + ->with( |
|
141 | + array('action' => 'accept'), |
|
142 | + array('name' => 'lang/organizations/invite', |
|
143 | 143 | 'query' => array('token' => $options['token'], 'organization' => $ownerOrg->getId())) |
144 | - ) |
|
145 | - ->willReturn('testUrl'); |
|
144 | + ) |
|
145 | + ->willReturn('testUrl'); |
|
146 | 146 | |
147 | 147 | $mailService = $this->getMockBuilder('\Core\Mail\MailService')->disableOriginalConstructor()->getMock(); |
148 | 148 | |
149 | 149 | $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager')->disableOriginalConstructor()->getMock(); |
150 | 150 | |
151 | 151 | $services->expects($this->exactly(3)) |
152 | - ->method('get') |
|
153 | - ->withConsecutive( |
|
154 | - array('AuthenticationService'), |
|
155 | - array('Router'), |
|
156 | - ['Core/MailService'] |
|
157 | - )->will($this->onConsecutiveCalls($authService, $router, $mailService)); |
|
152 | + ->method('get') |
|
153 | + ->withConsecutive( |
|
154 | + array('AuthenticationService'), |
|
155 | + array('Router'), |
|
156 | + ['Core/MailService'] |
|
157 | + )->will($this->onConsecutiveCalls($authService, $router, $mailService)); |
|
158 | 158 | |
159 | 159 | $mailMock = new HTMLTemplateMessage(new \Zend\ServiceManager\ServiceManager()); |
160 | 160 | $translator = $this->getMockBuilder('\Zend\I18n\Translator\Translator')->disableOriginalConstructor()->getMock(); |
@@ -60,7 +60,7 @@ |
||
60 | 60 | { |
61 | 61 | $user = $this->getMockForAbstractClass('\Auth\Entity\UserInterface'); |
62 | 62 | |
63 | - $makeArray = function ($options) use ($user) { |
|
63 | + $makeArray = function($options) use ($user) { |
|
64 | 64 | $options['user'] = $user; |
65 | 65 | return array($options, array_merge(array('user' => $user, 'token' => false, 'template' => 'organizations/mail/invite-employee'), $options)); |
66 | 66 | }; |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | public function testGetUriWithAndWithoutFilename() |
57 | 57 | { |
58 | - $filename="My File.png"; |
|
58 | + $filename = "My File.png"; |
|
59 | 59 | $this->target->setName($filename); |
60 | 60 | $this->assertSame($this->target->getUri(), '/file/Organizations.OrganizationImage/'.$this->target->getId().'/'.urlencode($this->target->getName())); |
61 | 61 | $this->target->setName(null); |
@@ -61,74 +61,74 @@ |
||
61 | 61 | $parent = new Organization(); |
62 | 62 | $permissions = $this->createMock(Permissions::class); |
63 | 63 | return [ |
64 | - [ 'externalId', '1234' ], |
|
65 | - [ 'name', [ 'value'=> '', 'ignore_setter' => true] ], |
|
66 | - [ 'name', [ 'pre' => 'setupGetName', 'value' => 'Test', 'ignore_setter' => true] ], |
|
67 | - [ 'organizationName' , [ |
|
68 | - '@value' => [ '\Organizations\Entity\OrganizationName', [ 'Test' ] ], |
|
64 | + ['externalId', '1234'], |
|
65 | + ['name', ['value'=> '', 'ignore_setter' => true]], |
|
66 | + ['name', ['pre' => 'setupGetName', 'value' => 'Test', 'ignore_setter' => true]], |
|
67 | + ['organizationName', [ |
|
68 | + '@value' => ['\Organizations\Entity\OrganizationName', ['Test']], |
|
69 | 69 | 'post' => 'organizationNamePostAsserts' |
70 | 70 | ]], |
71 | - [ 'organizationName', [ |
|
71 | + ['organizationName', [ |
|
72 | 72 | 'pre' => 'setupOrganizationName', |
73 | - '@value' => [ '\Organizations\Entity\OrganizationName', [ 'TestNew' ] ], |
|
73 | + '@value' => ['\Organizations\Entity\OrganizationName', ['TestNew']], |
|
74 | 74 | 'post' => 'assertOrganizationNameCounter' |
75 | 75 | ]], |
76 | - [ 'permissions',[ |
|
76 | + ['permissions', [ |
|
77 | 77 | 'value' => $permissions |
78 | 78 | ]], |
79 | - [ 'image',[ |
|
79 | + ['image', [ |
|
80 | 80 | 'value' => new OrganizationImage() |
81 | 81 | ]], |
82 | - [ 'images',[ |
|
82 | + ['images', [ |
|
83 | 83 | 'value' => new ImageSet(), |
84 | 84 | ]], |
85 | - [ 'isDraft',[ |
|
85 | + ['isDraft', [ |
|
86 | 86 | 'default' => false, |
87 | 87 | 'value' => true, |
88 | 88 | 'getter_method' => 'isDraft' |
89 | 89 | ]], |
90 | - [ 'contact',[ |
|
90 | + ['contact', [ |
|
91 | 91 | 'value' => new OrganizationContact() |
92 | 92 | ]], |
93 | - [ 'description',[ |
|
93 | + ['description', [ |
|
94 | 94 | 'default' => null, |
95 | 95 | 'value' => 'Some Description' |
96 | 96 | ]], |
97 | - [ 'parent',[ |
|
97 | + ['parent', [ |
|
98 | 98 | 'default' => null, |
99 | 99 | 'value' => $parent, |
100 | 100 | ]], |
101 | - [ 'hiringOrganizations',[ |
|
101 | + ['hiringOrganizations', [ |
|
102 | 102 | 'default' => null, |
103 | 103 | ]], |
104 | 104 | |
105 | - [ 'employees',[ |
|
105 | + ['employees', [ |
|
106 | 106 | '@default' => ArrayCollection::class, |
107 | 107 | 'value' => new ArrayCollection() |
108 | 108 | ]], |
109 | 109 | |
110 | - [ 'jobs',[ |
|
110 | + ['jobs', [ |
|
111 | 111 | 'default' => null, |
112 | 112 | ]], |
113 | 113 | |
114 | - [ 'user',[ |
|
114 | + ['user', [ |
|
115 | 115 | 'value' => new User() |
116 | 116 | ]], |
117 | 117 | |
118 | - [ 'template',[ |
|
118 | + ['template', [ |
|
119 | 119 | 'value' => new Template(), |
120 | 120 | ]], |
121 | 121 | |
122 | - [ 'workflowSettings',[ |
|
122 | + ['workflowSettings', [ |
|
123 | 123 | 'value' => new WorkflowSettings(), |
124 | 124 | ]], |
125 | 125 | |
126 | - [ 'profileSetting',[ |
|
126 | + ['profileSetting', [ |
|
127 | 127 | 'value' => Organization::PROFILE_ALWAYS_ENABLE, |
128 | 128 | 'default' => null, |
129 | 129 | ]], |
130 | 130 | |
131 | - [ 'hydrator', [ |
|
131 | + ['hydrator', [ |
|
132 | 132 | '@default' => EntityHydrator::class |
133 | 133 | ]] |
134 | 134 |
@@ -104,15 +104,15 @@ |
||
104 | 104 | ->getMock(); |
105 | 105 | |
106 | 106 | $target->expects($this->exactly(4)) |
107 | - ->method('add') |
|
108 | - ->withConsecutive( |
|
109 | - array($expectAdd1), |
|
110 | - array($expectAdd2), |
|
111 | - array($expectAdd3), |
|
112 | - array($expectAdd4) |
|
107 | + ->method('add') |
|
108 | + ->withConsecutive( |
|
109 | + array($expectAdd1), |
|
110 | + array($expectAdd2), |
|
111 | + array($expectAdd3), |
|
112 | + array($expectAdd4) |
|
113 | 113 | |
114 | 114 | |
115 | - ); |
|
115 | + ); |
|
116 | 116 | |
117 | 117 | $target->init(); |
118 | 118 | } |
@@ -88,11 +88,11 @@ |
||
88 | 88 | ->getMock(); |
89 | 89 | |
90 | 90 | $target->expects($this->exactly(2)) |
91 | - ->method('add') |
|
92 | - ->withConsecutive( |
|
93 | - array($expectAdd1), |
|
94 | - array($expectAdd2) |
|
95 | - ); |
|
91 | + ->method('add') |
|
92 | + ->withConsecutive( |
|
93 | + array($expectAdd1), |
|
94 | + array($expectAdd2) |
|
95 | + ); |
|
96 | 96 | |
97 | 97 | $target->init(); |
98 | 98 | $this->assertEquals('employees', $target->getName()); |
@@ -41,8 +41,8 @@ |
||
41 | 41 | $container->expects($this->any()) |
42 | 42 | ->method('get') |
43 | 43 | ->willReturnMap([ |
44 | - ['FilterManager',$filterManager], |
|
45 | - ['repositories',$repositories] |
|
44 | + ['FilterManager', $filterManager], |
|
45 | + ['repositories', $repositories] |
|
46 | 46 | ]) |
47 | 47 | ; |
48 | 48 |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$testConfig = include __DIR__ . '/TestConfig.php'; |
|
3 | +$testConfig = include __DIR__.'/TestConfig.php'; |
|
4 | 4 | |
5 | -require_once __DIR__ . '/../../../test/Bootstrap.php'; |
|
5 | +require_once __DIR__.'/../../../test/Bootstrap.php'; |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | public function testCreateServiceReturnsAssertionManager() |
33 | 33 | { |
34 | 34 | $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager') |
35 | - ->disableOriginalConstructor() |
|
36 | - ->getMock(); |
|
35 | + ->disableOriginalConstructor() |
|
36 | + ->getMock(); |
|
37 | 37 | |
38 | 38 | $services->expects($this->once())->method('get')->with('Config') |
39 | - ->willReturn(array()); |
|
39 | + ->willReturn(array()); |
|
40 | 40 | |
41 | 41 | $target = new AssertionManagerFactory(); |
42 | 42 | $manager = $target->__invoke($services, AssertionManager::class); |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | public function testCorrectConfigIsUsedToConfigureTheManager($config, $testName, $testResult) |
55 | 55 | { |
56 | 56 | $services = $this->getMockBuilder('\Zend\ServiceManager\ServiceManager') |
57 | - ->disableOriginalConstructor() |
|
58 | - ->getMock(); |
|
57 | + ->disableOriginalConstructor() |
|
58 | + ->getMock(); |
|
59 | 59 | |
60 | 60 | $services->expects($this->once())->method('get')->with('Config') |
61 | - ->willReturn($config); |
|
61 | + ->willReturn($config); |
|
62 | 62 | |
63 | 63 | $target = new AssertionManagerFactory(); |
64 | 64 |
@@ -64,7 +64,7 @@ |
||
64 | 64 | |
65 | 65 | $manager = $target->__invoke($services, AssertionManager::class); |
66 | 66 | |
67 | - $this->assertTrue($testResult === $manager->has($testName), 'Expected managers\' has method to return ' . ($testResult ? 'TRUE' : 'FALSE') . ' on ' .$testName); |
|
67 | + $this->assertTrue($testResult === $manager->has($testName), 'Expected managers\' has method to return '.($testResult ? 'TRUE' : 'FALSE').' on '.$testName); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | public function provideConfigArrays() |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | $acl = new Acl(); |
87 | 87 | |
88 | 88 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
89 | - ->disableOriginalConstructor() |
|
90 | - ->getMock(); |
|
89 | + ->disableOriginalConstructor() |
|
90 | + ->getMock(); |
|
91 | 91 | |
92 | 92 | $events->expects($this->once()) |
93 | - ->method('triggerUntil') |
|
94 | - ->willReturn(new ResponseCollection()); |
|
93 | + ->method('triggerUntil') |
|
94 | + ->willReturn(new ResponseCollection()); |
|
95 | 95 | |
96 | 96 | $target->setEventManager($events); |
97 | 97 | |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | $responseFalse = $this->createResponseMock(false); |
114 | 114 | |
115 | 115 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
116 | - ->disableOriginalConstructor() |
|
117 | - ->getMock(); |
|
116 | + ->disableOriginalConstructor() |
|
117 | + ->getMock(); |
|
118 | 118 | |
119 | 119 | $events->expects($this->exactly(5)) |
120 | - ->method('triggerUntil') |
|
121 | - ->will($this->onConsecutiveCalls($responseNull, $responseEmpty, $responseZero, $responseTrue, $responseFalse)); |
|
120 | + ->method('triggerUntil') |
|
121 | + ->will($this->onConsecutiveCalls($responseNull, $responseEmpty, $responseZero, $responseTrue, $responseFalse)); |
|
122 | 122 | |
123 | 123 | $target->setEventManager($events); |
124 | 124 | |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | protected function createResponseMock($returnValue) |
135 | 135 | { |
136 | 136 | $response = $this->getMockBuilder('\Zend\EventManager\ResponseCollection') |
137 | - ->disableOriginalConstructor() |
|
138 | - ->getMock(); |
|
137 | + ->disableOriginalConstructor() |
|
138 | + ->getMock(); |
|
139 | 139 | $response->method('last')->willReturn($returnValue); |
140 | 140 | |
141 | 141 | return $response; |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | $target = new TargetMock(); |
147 | 147 | |
148 | 148 | $events = $this->getMockBuilder('\Zend\EventManager\EventManager') |
149 | - ->disableOriginalConstructor() |
|
150 | - ->getMock(); |
|
149 | + ->disableOriginalConstructor() |
|
150 | + ->getMock(); |
|
151 | 151 | |
152 | 152 | $acl = new Acl(); |
153 | 153 | $role = new GenericRole('testRole'); |
@@ -156,16 +156,16 @@ discard block |
||
156 | 156 | $self = $this; |
157 | 157 | |
158 | 158 | $events->expects($this->once())->method('triggerUntil') |
159 | - ->will($this->returnCallback(function ($callback, $eventName, $event) use ($acl, $role, $resource, $privilege, $self) { |
|
160 | - $self->assertTrue(is_callable($callback)); |
|
161 | - $self->assertEquals('assert', $eventName); |
|
162 | - $self->assertSame($acl, $event->getAcl()); |
|
163 | - $self->assertSame($role, $event->getRole()); |
|
164 | - $self->assertSame($resource, $event->getResource()); |
|
165 | - $self->assertSame($privilege, $event->getPrivilege()); |
|
166 | - |
|
167 | - return new ResponseCollection(); |
|
168 | - })); |
|
159 | + ->will($this->returnCallback(function ($callback, $eventName, $event) use ($acl, $role, $resource, $privilege, $self) { |
|
160 | + $self->assertTrue(is_callable($callback)); |
|
161 | + $self->assertEquals('assert', $eventName); |
|
162 | + $self->assertSame($acl, $event->getAcl()); |
|
163 | + $self->assertSame($role, $event->getRole()); |
|
164 | + $self->assertSame($resource, $event->getResource()); |
|
165 | + $self->assertSame($privilege, $event->getPrivilege()); |
|
166 | + |
|
167 | + return new ResponseCollection(); |
|
168 | + })); |
|
169 | 169 | |
170 | 170 | $target->setEventManager($events); |
171 | 171 | $target->assert($acl, $role, $resource, $privilege); |
@@ -156,7 +156,7 @@ |
||
156 | 156 | $self = $this; |
157 | 157 | |
158 | 158 | $events->expects($this->once())->method('triggerUntil') |
159 | - ->will($this->returnCallback(function ($callback, $eventName, $event) use ($acl, $role, $resource, $privilege, $self) { |
|
159 | + ->will($this->returnCallback(function($callback, $eventName, $event) use ($acl, $role, $resource, $privilege, $self) { |
|
160 | 160 | $self->assertTrue(is_callable($callback)); |
161 | 161 | $self->assertEquals('assert', $eventName); |
162 | 162 | $self->assertSame($acl, $event->getAcl()); |