@@ -63,7 +63,7 @@ |
||
63 | 63 | ->getMock(); |
64 | 64 | $translator->expects($this->once()) |
65 | 65 | ->method('translate') |
66 | - ->with($this->callback(function ($string) { |
|
66 | + ->with($this->callback(function($string) { |
|
67 | 67 | return is_string($string); |
68 | 68 | })) |
69 | 69 | ->willReturn($expected); |
@@ -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); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $args = array($args); |
116 | 116 | } |
117 | 117 | |
118 | - for ($i=0,$c=count($func); $i<$c; $i+=1) { |
|
118 | + for ($i = 0, $c = count($func); $i < $c; $i += 1) { |
|
119 | 119 | $f = $func[$i]; |
120 | 120 | $a = $args[$i]; |
121 | 121 | |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | $expected = array($expected); |
145 | 145 | } |
146 | 146 | |
147 | - for ($i=0, $c=count($func); $i<$c; $i+=1) { |
|
147 | + for ($i = 0, $c = count($func); $i < $c; $i += 1) { |
|
148 | 148 | $f = $func[$i]; |
149 | 149 | $a = $args[$i]; |
150 | 150 | $e = $expected[$i]; |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | $perms = new Permissions(); |
177 | 177 | $contact = new OrganizationContact(); |
178 | 178 | $image = new OrganizationImage(); |
179 | - $externalId='myReference'; |
|
179 | + $externalId = 'myReference'; |
|
180 | 180 | $template = new Template(); |
181 | 181 | $template->setLabelBenefits('These are your Benefits'); |
182 | 182 | $workflowSettings = new WorkflowSettings(); |
@@ -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 |
@@ -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'; |
@@ -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() |
@@ -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()); |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | private $target = [ |
46 | 46 | UserSwitcher::class, |
47 | 47 | 'getSimpleAuthMock', |
48 | - '@testInheritance' => [ 'as_reflection' => true ], |
|
48 | + '@testInheritance' => ['as_reflection' => true], |
|
49 | 49 | '@testInvokationProxiesToCorrectMethods' => [ |
50 | 50 | 'args' => false, |
51 | - 'mock' => [ 'clear' => 1, 'switchUser' => ['with' => 'testUserId', 'count' => 1]], |
|
51 | + 'mock' => ['clear' => 1, 'switchUser' => ['with' => 'testUserId', 'count' => 1]], |
|
52 | 52 | ], |
53 | 53 | '@testClearRestoresOriginalUserAndClearsSession' => [ |
54 | 54 | 'args' => 'getComplexAuthMock', |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | ], |
65 | 65 | ]; |
66 | 66 | |
67 | - private $inheritance = [ AbstractPlugin::class ]; |
|
67 | + private $inheritance = [AbstractPlugin::class]; |
|
68 | 68 | |
69 | 69 | public function propertiesProvider() |
70 | 70 | { |
71 | - $createSession = function () { |
|
71 | + $createSession = function() { |
|
72 | 72 | $_SESSION[UserSwitcher::SESSION_NAMESPACE]['params'] = ['param' => 'value']; |
73 | 73 | }; |
74 | - $clearSession = function () { |
|
74 | + $clearSession = function() { |
|
75 | 75 | $_SESSION = []; |
76 | 76 | }; |
77 | 77 | return [ |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ->disableOriginalConstructor() |
114 | 114 | ->getMock(); |
115 | 115 | |
116 | - return [ $auth ]; |
|
116 | + return [$auth]; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | private function getComplexAuthMock() |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | $auth->expects($this->any())->method('getUser')->willReturn(new User()); |
140 | 140 | |
141 | - return [ $auth ]; |
|
141 | + return [$auth]; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | public function testInvokationProxiesToCorrectMethods() |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | public function returnReferenceProvider() |
156 | 156 | { |
157 | 157 | return [ |
158 | - [ null ], [ 'some/ref/uri' ], |
|
158 | + [null], ['some/ref/uri'], |
|
159 | 159 | ]; |
160 | 160 | } |
161 | 161 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $session = new Container(UserSwitcher::SESSION_NAMESPACE); |
170 | 170 | $session->isSwitchedUser = true; |
171 | 171 | $session->originalUser = 'switchedUser'; |
172 | - $oldSession = [ |
|
172 | + $oldSession = [ |
|
173 | 173 | 'oldSession' => true, |
174 | 174 | 'must' => 'be same' |
175 | 175 | ]; |