@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | */ |
27 | 27 | class CreatePaginatorEventTest extends TestCase |
28 | 28 | { |
29 | - use TestSetterGetterTrait,SetupTargetTrait; |
|
29 | + use TestSetterGetterTrait, SetupTargetTrait; |
|
30 | 30 | |
31 | 31 | protected $target = [ |
32 | 32 | 'class' => CreatePaginatorEvent::class |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | ->getMock() |
44 | 44 | ; |
45 | 45 | return [ |
46 | - ['paginatorParams',[ |
|
46 | + ['paginatorParams', [ |
|
47 | 47 | 'value' =>['name'=>'value'], |
48 | 48 | 'default' => array(), |
49 | 49 | ]], |
50 | - ['paginatorName',[ |
|
50 | + ['paginatorName', [ |
|
51 | 51 | 'value' => 'Some/Paginator', |
52 | 52 | 'default' => null, |
53 | 53 | ]], |
54 | - ['paginators',$paginators], |
|
55 | - ['paginator',$paginator] |
|
54 | + ['paginators', $paginators], |
|
55 | + ['paginator', $paginator] |
|
56 | 56 | ]; |
57 | 57 | } |
58 | 58 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | private $target = FileEvent::class; |
33 | 33 | |
34 | - private $inheritance = [ Event::class ]; |
|
34 | + private $inheritance = [Event::class]; |
|
35 | 35 | |
36 | 36 | public function propertiesProvider() |
37 | 37 | { |
@@ -41,13 +41,13 @@ discard block |
||
41 | 41 | ['params', [ |
42 | 42 | 'value' => ['file' => $file, 'one' => 'two'], |
43 | 43 | 'expect' => ['one' => 'two'], |
44 | - 'post' => function () use ($file) { |
|
44 | + 'post' => function() use ($file) { |
|
45 | 45 | $this->assertSame($file, $this->target->getFile()); |
46 | 46 | }, |
47 | 47 | ]], |
48 | 48 | ['file', $file], |
49 | 49 | ['file', [ |
50 | - 'pre' => function () use ($file) { |
|
50 | + 'pre' => function() use ($file) { |
|
51 | 51 | $this->target->setParam('file', $file); |
52 | 52 | }, |
53 | 53 | 'ignore_setter' => true, |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | '@testFactoryMethodReturnsInstance' => false |
42 | 42 | ]; |
43 | 43 | |
44 | - protected $inheritance = [ '\Zend\EventManager\ListenerAggregateInterface' ]; |
|
44 | + protected $inheritance = ['\Zend\EventManager\ListenerAggregateInterface']; |
|
45 | 45 | |
46 | 46 | protected $services; |
47 | 47 | |
@@ -56,39 +56,39 @@ discard block |
||
56 | 56 | public function propertiesProvider() |
57 | 57 | { |
58 | 58 | return [ |
59 | - [ 'listeners', [ |
|
60 | - 'value' => [ [] ], |
|
61 | - 'setter_exception' => [ '\DomainException', 'Listener specification must be an array' ] |
|
59 | + ['listeners', [ |
|
60 | + 'value' => [[]], |
|
61 | + 'setter_exception' => ['\DomainException', 'Listener specification must be an array'] |
|
62 | 62 | ]], |
63 | - [ 'listeners', [ |
|
64 | - 'value' => [ [ 'event' => 'test' ] ], |
|
65 | - 'setter_exception' => [ '\DomainException', 'Listener specification must be an array' ] |
|
63 | + ['listeners', [ |
|
64 | + 'value' => [['event' => 'test']], |
|
65 | + 'setter_exception' => ['\DomainException', 'Listener specification must be an array'] |
|
66 | 66 | ]], |
67 | - [ 'listeners', [ |
|
68 | - 'value' => [ [ 'service' => 'test' ] ], |
|
69 | - 'setter_exception' => [ '\DomainException', 'Listener specification must be an array' ] |
|
67 | + ['listeners', [ |
|
68 | + 'value' => [['service' => 'test']], |
|
69 | + 'setter_exception' => ['\DomainException', 'Listener specification must be an array'] |
|
70 | 70 | ]], |
71 | - [ 'listeners', [ |
|
72 | - 'value' => [ [ 'event' => 'test', 'service' => 'service' ] ], |
|
71 | + ['listeners', [ |
|
72 | + 'value' => [['event' => 'test', 'service' => 'service']], |
|
73 | 73 | 'ignore_getter' => true, |
74 | - 'post' => ['assertListenerSpecsProperty', [ '', '@target', '###' ] ], |
|
74 | + 'post' => ['assertListenerSpecsProperty', ['', '@target', '###']], |
|
75 | 75 | ]], |
76 | - [ 'listeners', [ |
|
77 | - 'value' => [ [ 'event' => 'test2', 'service' => 'someClass', 'method' => 'method', 'priority' => 12 ] ], |
|
76 | + ['listeners', [ |
|
77 | + 'value' => [['event' => 'test2', 'service' => 'someClass', 'method' => 'method', 'priority' => 12]], |
|
78 | 78 | 'ignore_getter' => true, |
79 | - 'post' => ['assertListenerSpecsProperty', [ '', '@target', '###' ] ], |
|
79 | + 'post' => ['assertListenerSpecsProperty', ['', '@target', '###']], |
|
80 | 80 | ]], |
81 | - [ 'listener', [ |
|
81 | + ['listener', [ |
|
82 | 82 | 'value' => 'test', |
83 | - 'setter_args' => [ 'service', 'method', 10 ], |
|
84 | - 'setter_value' => [ 'event' => 'test', 'service' => 'service', 'method' => 'method', 'priority' => 10, 'instance' => null ], |
|
83 | + 'setter_args' => ['service', 'method', 10], |
|
84 | + 'setter_value' => ['event' => 'test', 'service' => 'service', 'method' => 'method', 'priority' => 10, 'instance' => null], |
|
85 | 85 | 'setter_assert' => 'assertListenerSpecsProperty', |
86 | 86 | 'ignore_getter' => true, |
87 | 87 | ]], |
88 | - [ 'listener', [ |
|
88 | + ['listener', [ |
|
89 | 89 | 'value' => 'test', |
90 | - 'setter_args' => [ 'service', 10 ], |
|
91 | - 'setter_value' => [ 'event' => 'test', 'service' => 'service', 'method' => null, 'priority' => 10, 'instance' => null ], |
|
90 | + 'setter_args' => ['service', 10], |
|
91 | + 'setter_value' => ['event' => 'test', 'service' => 'service', 'method' => null, 'priority' => 10, 'instance' => null], |
|
92 | 92 | 'setter_assert' => 'assertListenerSpecsProperty', |
93 | 93 | 'ignore_getter' => true, |
94 | 94 | ]] |
@@ -132,20 +132,20 @@ discard block |
||
132 | 132 | $this->target->setListener('test02', 'service02', 10); |
133 | 133 | |
134 | 134 | //In ZF3 EventManager detach should be a callable or it will throws an error |
135 | - $callback = [$testListener,'callback']; |
|
135 | + $callback = [$testListener, 'callback']; |
|
136 | 136 | $events = $this->getMockBuilder(EventManager::class) |
137 | 137 | ->setMethods(['attach', 'detach']) |
138 | 138 | ->getMock(); |
139 | 139 | $events->expects($this->exactly(2)) |
140 | 140 | ->method('attach') |
141 | 141 | ->withConsecutive( |
142 | - [ $this->equalTo('test01'), $this->anything(), $this->equalTo(0) ], |
|
143 | - [ $this->equalTo('test02'), $this->anything(), $this->equalTo(10) ] |
|
142 | + [$this->equalTo('test01'), $this->anything(), $this->equalTo(0)], |
|
143 | + [$this->equalTo('test02'), $this->anything(), $this->equalTo(10)] |
|
144 | 144 | ) |
145 | 145 | ->will( |
146 | 146 | $this->onConsecutiveCalls( |
147 | - [$testListener,'callback'], |
|
148 | - [$testListener,'callback'] |
|
147 | + [$testListener, 'callback'], |
|
148 | + [$testListener, 'callback'] |
|
149 | 149 | ) |
150 | 150 | ); |
151 | 151 | |
@@ -186,13 +186,13 @@ discard block |
||
186 | 186 | public function listenerProvider() |
187 | 187 | { |
188 | 188 | return [ |
189 | - [ 'nonExistant', null ], |
|
190 | - [ '\CoreTest\Listener\DLATListenerMock', null ], |
|
191 | - [ 'listener', new DLATListenerMock() ], |
|
192 | - [ 'listener', new DLATListenerMock(), 'invoke' ], |
|
193 | - [ 'listener', new DLATListenerMock(), 'method', 'callback' ], |
|
194 | - [ 'listener', new DLATListenerMock(), 'methodButNone', 'noMethod' ], |
|
195 | - [ 'listener', new DLATNonInvokableListenerMock() ], |
|
189 | + ['nonExistant', null], |
|
190 | + ['\CoreTest\Listener\DLATListenerMock', null], |
|
191 | + ['listener', new DLATListenerMock()], |
|
192 | + ['listener', new DLATListenerMock(), 'invoke'], |
|
193 | + ['listener', new DLATListenerMock(), 'method', 'callback'], |
|
194 | + ['listener', new DLATListenerMock(), 'methodButNone', 'noMethod'], |
|
195 | + ['listener', new DLATNonInvokableListenerMock()], |
|
196 | 196 | ]; |
197 | 197 | } |
198 | 198 | |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | if (null === $listener) { |
212 | 212 | if (!class_exists($service, true)) { |
213 | 213 | $this->expectException('\UnexpectedValueException'); |
214 | - $this->expectExceptionMessage('Cannot create deferred listener "' . $service); |
|
214 | + $this->expectExceptionMessage('Cannot create deferred listener "'.$service); |
|
215 | 215 | } |
216 | 216 | $this->services->expects($this->once())->method('has')->with($service)->willReturn(false); |
217 | 217 | $this->services->expects($this->never())->method('get'); |
@@ -153,11 +153,11 @@ discard block |
||
153 | 153 | 'delay' => 100, |
154 | 154 | ]; |
155 | 155 | $resultMock = $this->getMockBuilder(\MongoDB\InsertOneResult::class)->disableOriginalConstructor() |
156 | - ->setMethods(['getInsertedId'])->getMock(); |
|
156 | + ->setMethods(['getInsertedId'])->getMock(); |
|
157 | 157 | $resultMock->expects($this->once())->method('getInsertedId')->willReturn('ID'); |
158 | 158 | $this->mongoCollectionMock->expects($this->once())->method('insertOne') |
159 | - ->with($this->callback(function ($value) use ($options) { |
|
160 | - return isset($value['queue']) && $value['queue'] == $this->queueName |
|
159 | + ->with($this->callback(function ($value) use ($options) { |
|
160 | + return isset($value['queue']) && $value['queue'] == $this->queueName |
|
161 | 161 | && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING |
162 | 162 | && !isset($value['tried']) |
163 | 163 | && !isset($value['message']) && !isset($value['trace']) |
@@ -166,9 +166,9 @@ discard block |
||
166 | 166 | && $value['created'] instanceof \MongoDB\BSON\UTCDateTime |
167 | 167 | && (int) ((string) $value['scheduled']) - (int) ((string)$value['created']) == $options['delay'] * 1000 |
168 | 168 | && isset($value['priority']) && $value['priority'] == $options['priority'] |
169 | - ; |
|
170 | - })) |
|
171 | - ->willReturn($resultMock); |
|
169 | + ; |
|
170 | + })) |
|
171 | + ->willReturn($resultMock); |
|
172 | 172 | |
173 | 173 | $this->target->push($job, $options); |
174 | 174 | |
@@ -184,21 +184,21 @@ discard block |
||
184 | 184 | |
185 | 185 | |
186 | 186 | $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate') |
187 | - ->with( |
|
188 | - $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]), |
|
189 | - $this->callback( |
|
190 | - function ($value) { |
|
191 | - if (!array_key_exists('$set', $value)) { |
|
192 | - return false; |
|
193 | - } |
|
194 | - $value = $value['$set']; |
|
195 | - return isset($value['tried']) && $value['tried'] == 10 |
|
187 | + ->with( |
|
188 | + $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]), |
|
189 | + $this->callback( |
|
190 | + function ($value) { |
|
191 | + if (!array_key_exists('$set', $value)) { |
|
192 | + return false; |
|
193 | + } |
|
194 | + $value = $value['$set']; |
|
195 | + return isset($value['tried']) && $value['tried'] == 10 |
|
196 | 196 | && !array_key_exists('created', $value) |
197 | 197 | ; |
198 | - } |
|
199 | - ) |
|
200 | - ) |
|
201 | - ->willReturn(null); |
|
198 | + } |
|
199 | + ) |
|
200 | + ) |
|
201 | + ->willReturn(null); |
|
202 | 202 | |
203 | 203 | $this->target->retry($job); |
204 | 204 | } |
@@ -215,33 +215,33 @@ discard block |
||
215 | 215 | |
216 | 216 | $this->jobManagerMock->expects($this->once())->method('get')->with(get_class($job))->willReturn(new $this->testJobClass()); |
217 | 217 | $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate') |
218 | - ->with( |
|
219 | - $this->callback(function ($value) { |
|
220 | - return |
|
218 | + ->with( |
|
219 | + $this->callback(function ($value) { |
|
220 | + return |
|
221 | 221 | isset($value['queue']) && $value['queue'] == $this->queueName |
222 | 222 | && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING |
223 | 223 | && isset($value['scheduled']['$lte']) && $value['scheduled']['$lte'] instanceof \MongoDB\BSON\UTCDateTime |
224 | - ; |
|
225 | - }), |
|
226 | - $this->callback( |
|
227 | - function ($value) { |
|
228 | - if (!array_key_exists('$set', $value)) { |
|
229 | - return false; |
|
230 | - } |
|
231 | - $value = $value['$set']; |
|
232 | - return isset($value['status']) && $value['status'] == MongoQueue::STATUS_RUNNING |
|
224 | + ; |
|
225 | + }), |
|
226 | + $this->callback( |
|
227 | + function ($value) { |
|
228 | + if (!array_key_exists('$set', $value)) { |
|
229 | + return false; |
|
230 | + } |
|
231 | + $value = $value['$set']; |
|
232 | + return isset($value['status']) && $value['status'] == MongoQueue::STATUS_RUNNING |
|
233 | 233 | && array_key_exists('executed', $value) |
234 | - ; |
|
235 | - } |
|
236 | - ), |
|
237 | - $this->callback(function ($value) { |
|
238 | - return |
|
234 | + ; |
|
235 | + } |
|
236 | + ), |
|
237 | + $this->callback(function ($value) { |
|
238 | + return |
|
239 | 239 | isset($value['sort']) && $value['sort'] == ['priority' => 1, 'scheduled' => 1] |
240 | 240 | && isset($value['returnDocument'])&&$value['returnDocument'] = \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER |
241 | - ; |
|
242 | - }) |
|
243 | - ) |
|
244 | - ->willReturn($envelope); |
|
241 | + ; |
|
242 | + }) |
|
243 | + ) |
|
244 | + ->willReturn($envelope); |
|
245 | 245 | |
246 | 246 | $actualJob = $this->target->pop(); |
247 | 247 | |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | public function testPopEmptyQueue() |
252 | 252 | { |
253 | 253 | $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate') |
254 | - ->willReturn(null); |
|
254 | + ->willReturn(null); |
|
255 | 255 | |
256 | 256 | $actualJob = $this->target->pop(); |
257 | 257 | |
@@ -335,8 +335,8 @@ discard block |
||
335 | 335 | }; |
336 | 336 | |
337 | 337 | $this->mongoCollectionMock->expects($this->once())->method('find') |
338 | - ->with($filter, $opt) |
|
339 | - ->willReturn($cursor); |
|
338 | + ->with($filter, $opt) |
|
339 | + ->willReturn($cursor); |
|
340 | 340 | |
341 | 341 | $this->target->listing($options); |
342 | 342 | } |
@@ -348,23 +348,23 @@ discard block |
||
348 | 348 | $job->setId(new \MongoDB\BSON\ObjectID()); |
349 | 349 | $options = ['message' => 'test failure message']; |
350 | 350 | $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate') |
351 | - ->with( |
|
352 | - $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]), |
|
353 | - $this->callback( |
|
354 | - function ($value) use ($options) { |
|
355 | - if (!array_key_exists('$set', $value)) { |
|
356 | - return false; |
|
357 | - } |
|
358 | - $value = $value['$set']; |
|
359 | - return isset($value['status']) && $value['status'] == MongoQueue::STATUS_FAILED |
|
351 | + ->with( |
|
352 | + $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]), |
|
353 | + $this->callback( |
|
354 | + function ($value) use ($options) { |
|
355 | + if (!array_key_exists('$set', $value)) { |
|
356 | + return false; |
|
357 | + } |
|
358 | + $value = $value['$set']; |
|
359 | + return isset($value['status']) && $value['status'] == MongoQueue::STATUS_FAILED |
|
360 | 360 | && !array_key_exists('created', $value) |
361 | 361 | && !array_key_exists('scheduled', $value) |
362 | 362 | && isset($value['message']) && $value['message'] == $options['message'] |
363 | - ; |
|
364 | - } |
|
365 | - ) |
|
366 | - ) |
|
367 | - ->willReturn(null); |
|
363 | + ; |
|
364 | + } |
|
365 | + ) |
|
366 | + ) |
|
367 | + ->willReturn(null); |
|
368 | 368 | |
369 | 369 | $this->target->fail($job, $options); |
370 | 370 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | private $target = [ |
38 | 38 | MongoQueue::class, |
39 | 39 | 'setupArgs', |
40 | - '@testInheritance' => [ 'as_reflection' => true ], |
|
40 | + '@testInheritance' => ['as_reflection' => true], |
|
41 | 41 | '@testConstruction' => false, |
42 | 42 | '@testPushLazyWithStringName' => '#mockPush', |
43 | 43 | '@testPushLazyWithArraySpec' => '#mockPush', |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | ] |
47 | 47 | ]; |
48 | 48 | |
49 | - private $inheritance = [ AbstractQueue::class ]; |
|
49 | + private $inheritance = [AbstractQueue::class]; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | ->setMethods(['getInsertedId'])->getMock(); |
128 | 128 | $resultMock->expects($this->once())->method('getInsertedId')->willReturn('ID'); |
129 | 129 | $this->mongoCollectionMock->expects($this->once())->method('insertOne') |
130 | - ->with($this->callback(function ($value) { |
|
130 | + ->with($this->callback(function($value) { |
|
131 | 131 | return isset($value['queue']) && $value['queue'] == $this->queueName |
132 | 132 | && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING |
133 | 133 | && !isset($value['tried']) |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | ->setMethods(['getInsertedId'])->getMock(); |
157 | 157 | $resultMock->expects($this->once())->method('getInsertedId')->willReturn('ID'); |
158 | 158 | $this->mongoCollectionMock->expects($this->once())->method('insertOne') |
159 | - ->with($this->callback(function ($value) use ($options) { |
|
159 | + ->with($this->callback(function($value) use ($options) { |
|
160 | 160 | return isset($value['queue']) && $value['queue'] == $this->queueName |
161 | 161 | && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING |
162 | 162 | && !isset($value['tried']) |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | && isset($value['created']) && isset($value['scheduled']) |
165 | 165 | && $value['scheduled'] instanceof \MongoDB\BSON\UTCDateTime |
166 | 166 | && $value['created'] instanceof \MongoDB\BSON\UTCDateTime |
167 | - && (int) ((string) $value['scheduled']) - (int) ((string)$value['created']) == $options['delay'] * 1000 |
|
167 | + && (int) ((string) $value['scheduled']) - (int) ((string) $value['created']) == $options['delay'] * 1000 |
|
168 | 168 | && isset($value['priority']) && $value['priority'] == $options['priority'] |
169 | 169 | ; |
170 | 170 | })) |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | ->with( |
188 | 188 | $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]), |
189 | 189 | $this->callback( |
190 | - function ($value) { |
|
190 | + function($value) { |
|
191 | 191 | if (!array_key_exists('$set', $value)) { |
192 | 192 | return false; |
193 | 193 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $this->jobManagerMock->expects($this->once())->method('get')->with(get_class($job))->willReturn(new $this->testJobClass()); |
217 | 217 | $this->mongoCollectionMock->expects($this->once())->method('findOneAndUpdate') |
218 | 218 | ->with( |
219 | - $this->callback(function ($value) { |
|
219 | + $this->callback(function($value) { |
|
220 | 220 | return |
221 | 221 | isset($value['queue']) && $value['queue'] == $this->queueName |
222 | 222 | && isset($value['status']) && $value['status'] == MongoQueue::STATUS_PENDING |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | ; |
225 | 225 | }), |
226 | 226 | $this->callback( |
227 | - function ($value) { |
|
227 | + function($value) { |
|
228 | 228 | if (!array_key_exists('$set', $value)) { |
229 | 229 | return false; |
230 | 230 | } |
@@ -234,10 +234,10 @@ discard block |
||
234 | 234 | ; |
235 | 235 | } |
236 | 236 | ), |
237 | - $this->callback(function ($value) { |
|
237 | + $this->callback(function($value) { |
|
238 | 238 | return |
239 | 239 | isset($value['sort']) && $value['sort'] == ['priority' => 1, 'scheduled' => 1] |
240 | - && isset($value['returnDocument'])&&$value['returnDocument'] = \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER |
|
240 | + && isset($value['returnDocument']) && $value['returnDocument'] = \MongoDB\Operation\FindOneAndUpdate::RETURN_DOCUMENT_AFTER |
|
241 | 241 | ; |
242 | 242 | }) |
243 | 243 | ) |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | /* @var AbstractJob $job2 */ |
265 | 265 | $job1 = new $this->testJobClass('TestJob1'); |
266 | 266 | $job2 = new $this->testJobClass('TestJob2'); |
267 | - $filter = [ 'queue' => $this->queueName ]; |
|
268 | - $opt = [ 'sort' => [ 'scheduled' => 1, 'priority' => 1 ] ]; |
|
267 | + $filter = ['queue' => $this->queueName]; |
|
268 | + $opt = ['sort' => ['scheduled' => 1, 'priority' => 1]]; |
|
269 | 269 | $envelopes = [ |
270 | 270 | [ |
271 | 271 | '_id' => $job1->getId(), |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | ], |
282 | 282 | ]; |
283 | 283 | $this->jobManagerMock->expects($this->exactly(2))->method('get') |
284 | - ->with($this->testJobClass)->will($this->returnCallback(function () { |
|
284 | + ->with($this->testJobClass)->will($this->returnCallback(function() { |
|
285 | 285 | return new $this->testJobClass(); |
286 | 286 | })); |
287 | 287 | |
@@ -307,8 +307,8 @@ discard block |
||
307 | 307 | $jobs = $this->target->listing(); |
308 | 308 | |
309 | 309 | $this->assertEquals(1, $cursor->called, "Cursor::toArray should have been called exactly one time, but was called '{$cursor->called}' times'"); |
310 | - $this->assertTrue(is_array($jobs), 'Return value should have been an array, but is "' . gettype($jobs) . '" instead."'); |
|
311 | - $this->assertTrue(2 == count($jobs), 'Only 2 jobs should have been returned, but it were ' . count($jobs)); |
|
310 | + $this->assertTrue(is_array($jobs), 'Return value should have been an array, but is "'.gettype($jobs).'" instead."'); |
|
311 | + $this->assertTrue(2 == count($jobs), 'Only 2 jobs should have been returned, but it were '.count($jobs)); |
|
312 | 312 | |
313 | 313 | $this->assertArrayHasKey('job', $jobs[0]); |
314 | 314 | $this->assertEquals($job1, $jobs[0]['job'], 'Job1 is not the same'); |
@@ -323,8 +323,8 @@ discard block |
||
323 | 323 | 'limit' => 10, |
324 | 324 | ]; |
325 | 325 | |
326 | - $filter = [ 'queue' => $this->queueName, 'status' => $options['status'] ]; |
|
327 | - $opt = [ 'sort' => [ 'scheduled' => 1, 'priority' => 1 ], 'limit' => $options['limit'] ]; |
|
326 | + $filter = ['queue' => $this->queueName, 'status' => $options['status']]; |
|
327 | + $opt = ['sort' => ['scheduled' => 1, 'priority' => 1], 'limit' => $options['limit']]; |
|
328 | 328 | |
329 | 329 | $this->jobManagerMock->expects($this->never())->method('get'); |
330 | 330 | $cursor = new class() { |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | ->with( |
352 | 352 | $this->equalTo(['_id' => new \MongoDB\BSON\ObjectID($job->getId())]), |
353 | 353 | $this->callback( |
354 | - function ($value) use ($options) { |
|
354 | + function($value) use ($options) { |
|
355 | 355 | if (!array_key_exists('$set', $value)) { |
356 | 356 | return false; |
357 | 357 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | private $target = MongoQueueFactory::class; |
40 | 40 | |
41 | - private $inheritance = [ FactoryInterface::class ]; |
|
41 | + private $inheritance = [FactoryInterface::class]; |
|
42 | 42 | |
43 | 43 | public function testCreateServiceWithoutConfig() |
44 | 44 | { |
@@ -49,7 +49,7 @@ |
||
49 | 49 | '@testConstructor*' => false, |
50 | 50 | ]; |
51 | 51 | |
52 | - private $inheritance = [ AbstractStrategy::class ]; |
|
52 | + private $inheritance = [AbstractStrategy::class]; |
|
53 | 53 | |
54 | 54 | private $attributes = [ |
55 | 55 | 'tmpl' => [ |
@@ -47,7 +47,7 @@ |
||
47 | 47 | ], |
48 | 48 | ]; |
49 | 49 | |
50 | - private $inheritance = [ FactoryInterface::class ]; |
|
50 | + private $inheritance = [FactoryInterface::class]; |
|
51 | 51 | |
52 | 52 | private function getInvocationArgs() |
53 | 53 | { |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | private $optionsMock; |
64 | 64 | |
65 | - private $inheritance = [ HydratorInterface::class ]; |
|
65 | + private $inheritance = [HydratorInterface::class]; |
|
66 | 66 | |
67 | 67 | private function getConstructorArgs() |
68 | 68 | { |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | ]; |
125 | 125 | |
126 | 126 | $imageSpecs = [ |
127 | - ImageSetInterface::THUMBNAIL => [100,100], |
|
128 | - 'large' => [10000,10000], |
|
129 | - 'small' => [600,600], |
|
127 | + ImageSetInterface::THUMBNAIL => [100, 100], |
|
128 | + 'large' => [10000, 10000], |
|
129 | + 'small' => [600, 600], |
|
130 | 130 | ]; |
131 | 131 | |
132 | 132 | $entityMock = $this->getMockBuilder(Image::class)->setMethods(['setFile', 'setName', 'setType'])->getMock(); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | |
33 | 33 | private $target = Image::class; |
34 | 34 | |
35 | - private $inheritance = [ FileEntity::class, ImageInterface::class ]; |
|
35 | + private $inheritance = [FileEntity::class, ImageInterface::class]; |
|
36 | 36 | |
37 | - private $traits = [ ImageTrait::class ]; |
|
37 | + private $traits = [ImageTrait::class]; |
|
38 | 38 | } |