Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ea822c6

Browse files
authoredJun 7, 2019
Merge pull request #889 from Steveb-p/fix-code-style
Fix Code Style in all files
2 parents fbc04ae + 07b6a1b commit ea822c6

26 files changed

+180
-180
lines changed
 

‎pkg/amqp-lib/Tests/AmqpProducerTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ public function testShouldPublishMessageToTopic()
6161
->expects($this->once())
6262
->method('basic_publish')
6363
->with($this->isInstanceOf(LibAMQPMessage::class), 'topic', 'routing-key')
64-
->will($this->returnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
64+
->willReturnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
6565
$amqpMessage = $message;
66-
}))
66+
})
6767
;
6868

6969
$topic = new AmqpTopic('topic');
@@ -86,9 +86,9 @@ public function testShouldPublishMessageToQueue()
8686
->expects($this->once())
8787
->method('basic_publish')
8888
->with($this->isInstanceOf(LibAMQPMessage::class), $this->isEmpty(), 'queue')
89-
->will($this->returnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
89+
->willReturnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
9090
$amqpMessage = $message;
91-
}))
91+
})
9292
;
9393

9494
$queue = new AmqpQueue('queue');
@@ -107,9 +107,9 @@ public function testShouldSetMessageHeaders()
107107
$channel
108108
->expects($this->once())
109109
->method('basic_publish')
110-
->will($this->returnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
110+
->willReturnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
111111
$amqpMessage = $message;
112-
}))
112+
})
113113
;
114114

115115
$producer = new AmqpProducer($channel, $this->createContextMock());
@@ -126,9 +126,9 @@ public function testShouldSetMessageProperties()
126126
$channel
127127
->expects($this->once())
128128
->method('basic_publish')
129-
->will($this->returnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
129+
->willReturnCallback(function (LibAMQPMessage $message) use (&$amqpMessage) {
130130
$amqpMessage = $message;
131-
}))
131+
})
132132
;
133133

134134
$producer = new AmqpProducer($channel, $this->createContextMock());

‎pkg/dbal/DbalConsumer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
class DbalConsumer implements Consumer
1515
{
16-
use ConsumerPollingTrait,
17-
DbalConsumerHelperTrait;
16+
use ConsumerPollingTrait;
17+
use DbalConsumerHelperTrait;
1818

1919
/**
2020
* @var DbalContext

‎pkg/dbal/DbalMessage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class DbalMessage implements Message
4949
private $timeToLive;
5050

5151
/**
52-
* @var null|string
52+
* @var string|null
5353
*/
5454
private $deliveryId;
5555

‎pkg/dbal/Tests/DbalConsumerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ public function testShouldDeleteMessageOnAcknowledge()
7979
$context
8080
->expects($this->once())
8181
->method('getDbalConnection')
82-
->will($this->returnValue($dbal))
82+
->willReturn($dbal)
8383
;
8484
$context
8585
->expects($this->once())
8686
->method('getTableName')
87-
->will($this->returnValue('some-table-name'))
87+
->willReturn('some-table-name')
8888
;
8989

9090
$consumer = new DbalConsumer($context, $queue);
@@ -150,12 +150,12 @@ public function testShouldDeleteMessageFromQueueOnReject()
150150
$context
151151
->expects($this->once())
152152
->method('getDbalConnection')
153-
->will($this->returnValue($dbal))
153+
->willReturn($dbal)
154154
;
155155
$context
156156
->expects($this->once())
157157
->method('getTableName')
158-
->will($this->returnValue('some-table-name'))
158+
->willReturn('some-table-name')
159159
;
160160

161161
$consumer = new DbalConsumer($context, $queue);
@@ -182,7 +182,7 @@ public function testRejectShouldReSendMessageToSameQueueOnRequeue()
182182
$context
183183
->expects($this->once())
184184
->method('createProducer')
185-
->will($this->returnValue($producerMock))
185+
->willReturn($producerMock)
186186
;
187187

188188
$consumer = new DbalConsumer($context, $queue);

‎pkg/dbal/Tests/DbalSubscriptionConsumerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private function createDbalContextMock()
153153
}
154154

155155
/**
156-
* @param null|mixed $queueName
156+
* @param mixed|null $queueName
157157
*
158158
* @return Consumer|\PHPUnit_Framework_MockObject_MockObject
159159
*/

‎pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrineClearIdentityMapExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testShouldClearIdentityMap()
3232
$registry
3333
->expects($this->once())
3434
->method('getManagers')
35-
->will($this->returnValue(['manager-name' => $manager]))
35+
->willReturn(['manager-name' => $manager])
3636
;
3737

3838
$context = $this->createContext();

‎pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public function testShouldNotReconnectIfConnectionIsOK()
2626
$connection
2727
->expects($this->once())
2828
->method('isConnected')
29-
->will($this->returnValue(true))
29+
->willReturn(true)
3030
;
3131
$connection
3232
->expects($this->once())
3333
->method('ping')
34-
->will($this->returnValue(true))
34+
->willReturn(true)
3535
;
3636
$connection
3737
->expects($this->never())
@@ -52,7 +52,7 @@ public function testShouldNotReconnectIfConnectionIsOK()
5252
$registry
5353
->expects($this->once())
5454
->method('getConnections')
55-
->will($this->returnValue([$connection]))
55+
->willReturn([$connection])
5656
;
5757

5858
$extension = new DoctrinePingConnectionExtension($registry);
@@ -65,12 +65,12 @@ public function testShouldDoesReconnectIfConnectionFailed()
6565
$connection
6666
->expects($this->once())
6767
->method('isConnected')
68-
->will($this->returnValue(true))
68+
->willReturn(true)
6969
;
7070
$connection
7171
->expects($this->once())
7272
->method('ping')
73-
->will($this->returnValue(false))
73+
->willReturn(false)
7474
;
7575
$connection
7676
->expects($this->once())
@@ -97,7 +97,7 @@ public function testShouldDoesReconnectIfConnectionFailed()
9797
$registry
9898
->expects($this->once())
9999
->method('getConnections')
100-
->will($this->returnValue([$connection]))
100+
->willReturn([$connection])
101101
;
102102

103103
$extension = new DoctrinePingConnectionExtension($registry);
@@ -110,7 +110,7 @@ public function testShouldSkipIfConnectionWasNotOpened()
110110
$connection1
111111
->expects($this->once())
112112
->method('isConnected')
113-
->will($this->returnValue(false))
113+
->willReturn(false)
114114
;
115115
$connection1
116116
->expects($this->never())
@@ -122,12 +122,12 @@ public function testShouldSkipIfConnectionWasNotOpened()
122122
$connection2
123123
->expects($this->once())
124124
->method('isConnected')
125-
->will($this->returnValue(true))
125+
->willReturn(true)
126126
;
127127
$connection2
128128
->expects($this->once())
129129
->method('ping')
130-
->will($this->returnValue(true))
130+
->willReturn(true)
131131
;
132132

133133
$context = $this->createContext();
@@ -140,7 +140,7 @@ public function testShouldSkipIfConnectionWasNotOpened()
140140
$registry
141141
->expects($this->once())
142142
->method('getConnections')
143-
->will($this->returnValue([$connection1, $connection2]))
143+
->willReturn([$connection1, $connection2])
144144
;
145145

146146
$extension = new DoctrinePingConnectionExtension($registry);

‎pkg/enqueue/Client/Message.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ public function __construct($body = '', array $properties = [], array $headers =
8888
}
8989

9090
/**
91-
* @return null|string
91+
* @return string|null
9292
*/
9393
public function getBody()
9494
{
9595
return $this->body;
9696
}
9797

9898
/**
99-
* @param null|string|int|float|array|\JsonSerializable $body
99+
* @param string|int|float|array|\JsonSerializable|null $body
100100
*/
101101
public function setBody($body)
102102
{

‎pkg/enqueue/Consumption/Context/MessageResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getReceivedAt(): int
7676
}
7777

7878
/**
79-
* @return Result|null|object|string
79+
* @return Result|object|string|null
8080
*/
8181
public function getResult()
8282
{

‎pkg/enqueue/Tests/Client/DelegateProcessorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ public function testShouldProcessMessage()
3939
->expects($this->once())
4040
->method('process')
4141
->with($this->identicalTo($message), $this->identicalTo($session))
42-
->will($this->returnValue('return-value'))
42+
->willReturn('return-value')
4343
;
4444

4545
$processorRegistry = $this->createProcessorRegistryMock();
4646
$processorRegistry
4747
->expects($this->once())
4848
->method('get')
4949
->with('processor-name')
50-
->will($this->returnValue($processor))
50+
->willReturn($processor)
5151
;
5252

5353
$processor = new DelegateProcessor($processorRegistry);

‎pkg/enqueue/Tests/Client/Extension/PrepareBodyExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function testCouldConstructedWithoutAnyArguments()
3131
* @dataProvider provideMessages
3232
*
3333
* @param mixed $body
34-
* @param null|mixed $contentType
34+
* @param mixed|null $contentType
3535
*/
3636
public function testShouldSendStringUnchangedAndAddPlainTextContentTypeIfEmpty(
3737
$body,

‎pkg/enqueue/Tests/Consumption/FallbackSubscriptionConsumerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ public function testShouldConsumeTillTimeoutIsReached()
227227
}
228228

229229
/**
230-
* @param null|mixed $body
230+
* @param mixed|null $body
231231
*
232232
* @return InteropMessage|\PHPUnit_Framework_MockObject_MockObject
233233
*/
@@ -244,7 +244,7 @@ private function createMessageStub($body = null)
244244
}
245245

246246
/**
247-
* @param null|mixed $queueName
247+
* @param mixed|null $queueName
248248
*
249249
* @return Consumer|\PHPUnit_Framework_MockObject_MockObject
250250
*/

‎pkg/job-queue/Tests/CalculateRootJobStatusProcessorTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function testShouldCallCalculateJobRootStatusAndACKMessage()
103103
->expects($this->once())
104104
->method('findJobById')
105105
->with('12345')
106-
->will($this->returnValue($job))
106+
->willReturn($job)
107107
;
108108

109109
$logger = $this->createLoggerMock();
@@ -146,7 +146,7 @@ public function testShouldSendRootJobStoppedMessageIfJobHasStopped()
146146
->expects($this->once())
147147
->method('findJobById')
148148
->with('12345')
149-
->will($this->returnValue($job))
149+
->willReturn($job)
150150
;
151151

152152
$logger = $this->createLoggerMock();
@@ -156,7 +156,7 @@ public function testShouldSendRootJobStoppedMessageIfJobHasStopped()
156156
->expects($this->once())
157157
->method('calculate')
158158
->with($this->identicalTo($job))
159-
->will($this->returnValue(true))
159+
->willReturn(true)
160160
;
161161

162162
$producer = $this->createProducerMock();

‎pkg/job-queue/Tests/CalculateRootJobStatusServiceTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ public function testShouldCalculateRootJobStatus()
6060
$storage
6161
->expects($this->once())
6262
->method('saveJob')
63-
->will($this->returnCallback(function (Job $job, $callback) {
63+
->willReturnCallback(function (Job $job, $callback) {
6464
$callback($job);
65-
}))
65+
})
6666
;
6767

6868
$case = new CalculateRootJobStatusService($storage);
@@ -92,9 +92,9 @@ public function testShouldCalculateRootJobStatusAndSetStoppedAtTimeIfGotStopStat
9292
$storage
9393
->expects($this->once())
9494
->method('saveJob')
95-
->will($this->returnCallback(function (Job $job, $callback) {
95+
->willReturnCallback(function (Job $job, $callback) {
9696
$callback($job);
97-
}))
97+
})
9898
;
9999

100100
$case = new CalculateRootJobStatusService($storage);
@@ -120,9 +120,9 @@ public function testShouldSetStoppedAtOnlyIfWasNotSet()
120120
$em
121121
->expects($this->once())
122122
->method('saveJob')
123-
->will($this->returnCallback(function (Job $job, $callback) {
123+
->willReturnCallback(function (Job $job, $callback) {
124124
$callback($job);
125-
}))
125+
})
126126
;
127127

128128
$case = new CalculateRootJobStatusService($em);
@@ -146,9 +146,9 @@ public function testShouldThrowIfInvalidStatus()
146146
$storage
147147
->expects($this->once())
148148
->method('saveJob')
149-
->will($this->returnCallback(function (Job $job, $callback) {
149+
->willReturnCallback(function (Job $job, $callback) {
150150
$callback($job);
151-
}))
151+
})
152152
;
153153

154154
$case = new CalculateRootJobStatusService($storage);
@@ -179,9 +179,9 @@ public function testShouldSetStatusNewIfAllChildAreNew()
179179
$storage
180180
->expects($this->once())
181181
->method('saveJob')
182-
->will($this->returnCallback(function (Job $job, $callback) {
182+
->willReturnCallback(function (Job $job, $callback) {
183183
$callback($job);
184-
}))
184+
})
185185
;
186186

187187
$case = new CalculateRootJobStatusService($storage);
@@ -212,9 +212,9 @@ public function testShouldSetStatusRunningIfAnyOneIsRunning()
212212
$storage
213213
->expects($this->once())
214214
->method('saveJob')
215-
->will($this->returnCallback(function (Job $job, $callback) {
215+
->willReturnCallback(function (Job $job, $callback) {
216216
$callback($job);
217-
}))
217+
})
218218
;
219219

220220
$case = new CalculateRootJobStatusService($storage);
@@ -245,9 +245,9 @@ public function testShouldSetStatusRunningIfThereIsNoRunningButNewAndAnyOfStopSt
245245
$storage
246246
->expects($this->once())
247247
->method('saveJob')
248-
->will($this->returnCallback(function (Job $job, $callback) {
248+
->willReturnCallback(function (Job $job, $callback) {
249249
$callback($job);
250-
}))
250+
})
251251
;
252252

253253
$case = new CalculateRootJobStatusService($storage);
@@ -278,9 +278,9 @@ public function testShouldSetStatusCancelledIfAllIsStopButOneIsCancelled()
278278
$storage
279279
->expects($this->once())
280280
->method('saveJob')
281-
->will($this->returnCallback(function (Job $job, $callback) {
281+
->willReturnCallback(function (Job $job, $callback) {
282282
$callback($job);
283-
}))
283+
})
284284
;
285285

286286
$case = new CalculateRootJobStatusService($storage);
@@ -311,9 +311,9 @@ public function testShouldSetStatusFailedIfThereIsAnyOneIsFailedButIsNotCancelle
311311
$storage
312312
->expects($this->once())
313313
->method('saveJob')
314-
->will($this->returnCallback(function (Job $job, $callback) {
314+
->willReturnCallback(function (Job $job, $callback) {
315315
$callback($job);
316-
}))
316+
})
317317
;
318318

319319
$case = new CalculateRootJobStatusService($storage);
@@ -344,9 +344,9 @@ public function testShouldSetStatusSuccessIfAllAreSuccess()
344344
$storage
345345
->expects($this->once())
346346
->method('saveJob')
347-
->will($this->returnCallback(function (Job $job, $callback) {
347+
->willReturnCallback(function (Job $job, $callback) {
348348
$callback($job);
349-
}))
349+
})
350350
;
351351

352352
$case = new CalculateRootJobStatusService($storage);

‎pkg/job-queue/Tests/DependentJobProcessorTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public function testShouldLogCriticalAndRejectMessageIfJobIsNotRoot()
8484
->expects($this->once())
8585
->method('findJobById')
8686
->with(12345)
87-
->will($this->returnValue($job))
87+
->willReturn($job)
8888
;
8989

9090
$producer = $this->createProducerMock();
@@ -115,7 +115,7 @@ public function testShouldDoNothingIfDependentJobsAreMissing()
115115
->expects($this->once())
116116
->method('findJobById')
117117
->with(12345)
118-
->will($this->returnValue($job))
118+
->willReturn($job)
119119
;
120120

121121
$producer = $this->createProducerMock();
@@ -151,7 +151,7 @@ public function testShouldLogCriticalAndRejectMessageIfDependentJobTopicIsMissin
151151
->expects($this->once())
152152
->method('findJobById')
153153
->with(12345)
154-
->will($this->returnValue($job))
154+
->willReturn($job)
155155
;
156156

157157
$producer = $this->createProducerMock();
@@ -194,7 +194,7 @@ public function testShouldLogCriticalAndRejectMessageIfDependentJobMessageIsMiss
194194
->expects($this->once())
195195
->method('findJobById')
196196
->with(12345)
197-
->will($this->returnValue($job))
197+
->willReturn($job)
198198
;
199199

200200
$producer = $this->createProducerMock();
@@ -239,7 +239,7 @@ public function testShouldPublishDependentMessage()
239239
->expects($this->once())
240240
->method('findJobById')
241241
->with(12345)
242-
->will($this->returnValue($job))
242+
->willReturn($job)
243243
;
244244

245245
$expectedMessage = null;
@@ -248,9 +248,9 @@ public function testShouldPublishDependentMessage()
248248
->expects($this->once())
249249
->method('sendEvent')
250250
->with('topic-name', $this->isInstanceOf(Message::class))
251-
->will($this->returnCallback(function ($topic, Message $message) use (&$expectedMessage) {
251+
->willReturnCallback(function ($topic, Message $message) use (&$expectedMessage) {
252252
$expectedMessage = $message;
253-
}))
253+
})
254254
;
255255

256256
$logger = $this->createLoggerMock();
@@ -287,7 +287,7 @@ public function testShouldPublishDependentMessageWithPriority()
287287
->expects($this->once())
288288
->method('findJobById')
289289
->with(12345)
290-
->will($this->returnValue($job))
290+
->willReturn($job)
291291
;
292292

293293
$expectedMessage = null;
@@ -296,9 +296,9 @@ public function testShouldPublishDependentMessageWithPriority()
296296
->expects($this->once())
297297
->method('sendEvent')
298298
->with('topic-name', $this->isInstanceOf(Message::class))
299-
->will($this->returnCallback(function ($topic, Message $message) use (&$expectedMessage) {
299+
->willReturnCallback(function ($topic, Message $message) use (&$expectedMessage) {
300300
$expectedMessage = $message;
301-
}))
301+
})
302302
;
303303

304304
$logger = $this->createLoggerMock();

‎pkg/job-queue/Tests/DependentJobServiceTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ public function testShouldSaveDependentJobs()
3838
$storage
3939
->expects($this->once())
4040
->method('saveJob')
41-
->will($this->returnCallback(function (Job $job, $callback) {
41+
->willReturnCallback(function (Job $job, $callback) {
4242
$callback($job);
4343

4444
return true;
45-
}))
45+
})
4646
;
4747

4848
$context = new DependentJobContext($job);

‎pkg/job-queue/Tests/Doctrine/JobStorageTest.php

Lines changed: 54 additions & 54 deletions
Large diffs are not rendered by default.

‎pkg/job-queue/Tests/JobProcessorTest.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function testShouldCreateRootJobAndReturnIt()
4343
$storage
4444
->expects($this->once())
4545
->method('createJob')
46-
->will($this->returnValue($job))
46+
->willReturn($job)
4747
;
4848
$storage
4949
->expects($this->once())
@@ -72,7 +72,7 @@ public function testShouldCatchDuplicateJobAndTryToFindJobByOwnerId()
7272
$storage
7373
->expects($this->once())
7474
->method('createJob')
75-
->will($this->returnValue($job))
75+
->willReturn($job)
7676
;
7777
$storage
7878
->expects($this->once())
@@ -84,7 +84,7 @@ public function testShouldCatchDuplicateJobAndTryToFindJobByOwnerId()
8484
->expects($this->once())
8585
->method('findRootJobByOwnerIdAndJobName')
8686
->with('owner-id', 'job-name')
87-
->will($this->returnValue($job))
87+
->willReturn($job)
8888
;
8989

9090
$processor = new JobProcessor($storage, $this->createProducerMock());
@@ -121,13 +121,13 @@ public function testCreateChildJobShouldFindAndReturnAlreadyCreatedJob()
121121
->expects($this->once())
122122
->method('findChildJobByName')
123123
->with('job-name', $this->identicalTo($job))
124-
->will($this->returnValue($job))
124+
->willReturn($job)
125125
;
126126
$storage
127127
->expects($this->once())
128128
->method('findJobById')
129129
->with(123)
130-
->will($this->returnValue($job))
130+
->willReturn($job)
131131
;
132132

133133
$processor = new JobProcessor($storage, $this->createProducerMock());
@@ -146,7 +146,7 @@ public function testCreateChildJobShouldCreateAndSaveJobAndPublishRecalculateRoo
146146
$storage
147147
->expects($this->once())
148148
->method('createJob')
149-
->will($this->returnValue($job))
149+
->willReturn($job)
150150
;
151151
$storage
152152
->expects($this->once())
@@ -157,13 +157,13 @@ public function testCreateChildJobShouldCreateAndSaveJobAndPublishRecalculateRoo
157157
->expects($this->once())
158158
->method('findChildJobByName')
159159
->with('job-name', $this->identicalTo($job))
160-
->will($this->returnValue(null))
160+
->willReturn(null)
161161
;
162162
$storage
163163
->expects($this->once())
164164
->method('findJobById')
165165
->with(12345)
166-
->will($this->returnValue($job))
166+
->willReturn($job)
167167
;
168168

169169
$producer = $this->createProducerMock();
@@ -210,7 +210,7 @@ public function testStartChildJobShouldThrowIfJobHasNotNewStatus()
210210
->expects($this->once())
211211
->method('findJobById')
212212
->with(12345)
213-
->will($this->returnValue($job))
213+
->willReturn($job)
214214
;
215215

216216
$processor = new JobProcessor($storage, $this->createProducerMock());
@@ -240,7 +240,7 @@ public function testStartJobShouldUpdateJobWithRunningStatusAndStartAtTime()
240240
->expects($this->once())
241241
->method('findJobById')
242242
->with(12345)
243-
->will($this->returnValue($job))
243+
->willReturn($job)
244244
;
245245

246246
$producer = $this->createProducerMock();
@@ -280,7 +280,7 @@ public function testSuccessChildJobShouldThrowIfJobHasNotRunningStatus()
280280
->expects($this->once())
281281
->method('findJobById')
282282
->with(12345)
283-
->will($this->returnValue($job))
283+
->willReturn($job)
284284
;
285285

286286
$processor = new JobProcessor($storage, $this->createProducerMock());
@@ -310,7 +310,7 @@ public function testSuccessJobShouldUpdateJobWithSuccessStatusAndStopAtTime()
310310
->expects($this->once())
311311
->method('findJobById')
312312
->with(12345)
313-
->will($this->returnValue($job))
313+
->willReturn($job)
314314
;
315315

316316
$producer = $this->createProducerMock();
@@ -350,7 +350,7 @@ public function testFailChildJobShouldThrowIfJobHasNotRunningStatus()
350350
->expects($this->once())
351351
->method('findJobById')
352352
->with(12345)
353-
->will($this->returnValue($job))
353+
->willReturn($job)
354354
;
355355

356356
$processor = new JobProcessor($storage, $this->createProducerMock());
@@ -380,7 +380,7 @@ public function testFailJobShouldUpdateJobWithFailStatusAndStopAtTime()
380380
->expects($this->once())
381381
->method('findJobById')
382382
->with(12345)
383-
->will($this->returnValue($job))
383+
->willReturn($job)
384384
;
385385

386386
$producer = $this->createProducerMock();
@@ -420,7 +420,7 @@ public function testCancelChildJobShouldThrowIfJobHasNotNewOrRunningStatus()
420420
->expects($this->once())
421421
->method('findJobById')
422422
->with(12345)
423-
->will($this->returnValue($job))
423+
->willReturn($job)
424424
;
425425

426426
$processor = new JobProcessor($storage, $this->createProducerMock());
@@ -450,7 +450,7 @@ public function testCancelJobShouldUpdateJobWithCancelStatusAndStoppedAtTimeAndS
450450
->expects($this->once())
451451
->method('findJobById')
452452
->with(12345)
453-
->will($this->returnValue($job))
453+
->willReturn($job)
454454
;
455455

456456
$producer = $this->createProducerMock();
@@ -505,9 +505,9 @@ public function testInterruptRootJobShouldUpdateJobAndSetInterruptedTrue()
505505
$storage
506506
->expects($this->once())
507507
->method('saveJob')
508-
->will($this->returnCallback(function (Job $job, $callback) {
508+
->willReturnCallback(function (Job $job, $callback) {
509509
$callback($job);
510-
}))
510+
})
511511
;
512512

513513
$processor = new JobProcessor($storage, $this->createProducerMock());
@@ -526,9 +526,9 @@ public function testInterruptRootJobShouldUpdateJobAndSetInterruptedTrueAndStopp
526526
$storage
527527
->expects($this->once())
528528
->method('saveJob')
529-
->will($this->returnCallback(function (Job $job, $callback) {
529+
->willReturnCallback(function (Job $job, $callback) {
530530
$callback($job);
531-
}))
531+
})
532532
;
533533

534534
$processor = new JobProcessor($storage, $this->createProducerMock());

‎pkg/job-queue/Tests/JobRunnerTest.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ public function testRunUniqueShouldCreateRootAndChildJobAndCallCallback()
1919
->expects($this->once())
2020
->method('findOrCreateRootJob')
2121
->with('owner-id', 'job-name', true)
22-
->will($this->returnValue($root))
22+
->willReturn($root)
2323
;
2424
$jobProcessor
2525
->expects($this->once())
2626
->method('findOrCreateChildJob')
2727
->with('job-name')
28-
->will($this->returnValue($child))
28+
->willReturn($child)
2929
;
3030

3131
$expChild = null;
@@ -57,12 +57,12 @@ public function testRunUniqueShouldStartChildJobIfNotStarted()
5757
$jobProcessor
5858
->expects($this->once())
5959
->method('findOrCreateRootJob')
60-
->will($this->returnValue($root))
60+
->willReturn($root)
6161
;
6262
$jobProcessor
6363
->expects($this->once())
6464
->method('findOrCreateChildJob')
65-
->will($this->returnValue($child))
65+
->willReturn($child)
6666
;
6767
$jobProcessor
6868
->expects($this->once())
@@ -85,12 +85,12 @@ public function testRunUniqueShouldNotStartChildJobIfAlreadyStarted()
8585
$jobProcessor
8686
->expects($this->once())
8787
->method('findOrCreateRootJob')
88-
->will($this->returnValue($root))
88+
->willReturn($root)
8989
;
9090
$jobProcessor
9191
->expects($this->once())
9292
->method('findOrCreateChildJob')
93-
->will($this->returnValue($child))
93+
->willReturn($child)
9494
;
9595
$jobProcessor
9696
->expects($this->never())
@@ -111,12 +111,12 @@ public function testRunUniqueShouldSuccessJobIfCallbackReturnValueIsTrue()
111111
$jobProcessor
112112
->expects($this->once())
113113
->method('findOrCreateRootJob')
114-
->will($this->returnValue($root))
114+
->willReturn($root)
115115
;
116116
$jobProcessor
117117
->expects($this->once())
118118
->method('findOrCreateChildJob')
119-
->will($this->returnValue($child))
119+
->willReturn($child)
120120
;
121121
$jobProcessor
122122
->expects($this->once())
@@ -142,12 +142,12 @@ public function testRunUniqueShouldFailJobIfCallbackReturnValueIsFalse()
142142
$jobProcessor
143143
->expects($this->once())
144144
->method('findOrCreateRootJob')
145-
->will($this->returnValue($root))
145+
->willReturn($root)
146146
;
147147
$jobProcessor
148148
->expects($this->once())
149149
->method('findOrCreateChildJob')
150-
->will($this->returnValue($child))
150+
->willReturn($child)
151151
;
152152
$jobProcessor
153153
->expects($this->never())
@@ -173,12 +173,12 @@ public function testRunUniqueShouldFailJobIfCallbackThrowsException()
173173
$jobProcessor
174174
->expects($this->once())
175175
->method('findOrCreateRootJob')
176-
->will($this->returnValue($root))
176+
->willReturn($root)
177177
;
178178
$jobProcessor
179179
->expects($this->once())
180180
->method('findOrCreateChildJob')
181-
->will($this->returnValue($child))
181+
->willReturn($child)
182182
;
183183
$jobProcessor
184184
->expects($this->never())
@@ -205,12 +205,12 @@ public function testRunUniqueShouldThrowOrphanJobExceptionIfChildCleanupFails()
205205
$jobProcessor
206206
->expects($this->once())
207207
->method('findOrCreateRootJob')
208-
->will($this->returnValue($root))
208+
->willReturn($root)
209209
;
210210
$jobProcessor
211211
->expects($this->once())
212212
->method('findOrCreateChildJob')
213-
->will($this->returnValue($child))
213+
->willReturn($child)
214214
;
215215
$jobProcessor
216216
->expects($this->never())
@@ -239,12 +239,12 @@ public function testRunUniqueShouldNotSuccessJobIfJobIsAlreadyStopped()
239239
$jobProcessor
240240
->expects($this->once())
241241
->method('findOrCreateRootJob')
242-
->will($this->returnValue($root))
242+
->willReturn($root)
243243
;
244244
$jobProcessor
245245
->expects($this->once())
246246
->method('findOrCreateChildJob')
247-
->will($this->returnValue($child))
247+
->willReturn($child)
248248
;
249249
$jobProcessor
250250
->expects($this->never())
@@ -271,7 +271,7 @@ public function testCreateDelayedShouldCreateChildJobAndCallCallback()
271271
->expects($this->once())
272272
->method('findOrCreateChildJob')
273273
->with('job-name', $this->identicalTo($root))
274-
->will($this->returnValue($child))
274+
->willReturn($child)
275275
;
276276

277277
$expRunner = null;
@@ -296,7 +296,7 @@ public function testRunDelayedShouldThrowExceptionIfJobWasNotFoundById()
296296
->expects($this->once())
297297
->method('findJobById')
298298
->with('job-id')
299-
->will($this->returnValue(null))
299+
->willReturn(null)
300300
;
301301

302302
$jobRunner = new JobRunner($jobProcessor);
@@ -318,7 +318,7 @@ public function testRunDelayedShouldFindJobAndCallCallback()
318318
->expects($this->once())
319319
->method('findJobById')
320320
->with('job-id')
321-
->will($this->returnValue($child))
321+
->willReturn($child)
322322
;
323323

324324
$expRunner = null;
@@ -348,7 +348,7 @@ public function testRunDelayedShouldCancelJobIfRootJobIsInterrupted()
348348
->expects($this->once())
349349
->method('findJobById')
350350
->with('job-id')
351-
->will($this->returnValue($child))
351+
->willReturn($child)
352352
;
353353
$jobProcessor
354354
->expects($this->once())
@@ -373,7 +373,7 @@ public function testRunDelayedShouldSuccessJobIfCallbackReturnValueIsTrue()
373373
->expects($this->once())
374374
->method('findJobById')
375375
->with('job-id')
376-
->will($this->returnValue($child))
376+
->willReturn($child)
377377
;
378378
$jobProcessor
379379
->expects($this->once())
@@ -402,7 +402,7 @@ public function testRunDelayedShouldFailJobIfCallbackReturnValueIsFalse()
402402
->expects($this->once())
403403
->method('findJobById')
404404
->with('job-id')
405-
->will($this->returnValue($child))
405+
->willReturn($child)
406406
;
407407
$jobProcessor
408408
->expects($this->never())
@@ -432,7 +432,7 @@ public function testRunDelayedShouldNotSuccessJobIfAlreadyStopped()
432432
->expects($this->once())
433433
->method('findJobById')
434434
->with('job-id')
435-
->will($this->returnValue($child))
435+
->willReturn($child)
436436
;
437437
$jobProcessor
438438
->expects($this->never())

‎pkg/mongodb/Tests/MongodbConsumerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function testRejectShouldReSendMessageToSameQueueOnRequeue()
104104
$context
105105
->expects($this->once())
106106
->method('createProducer')
107-
->will($this->returnValue($producerMock))
107+
->willReturn($producerMock)
108108
;
109109

110110
$consumer = new MongodbConsumer($context, $queue);

‎pkg/mongodb/Tests/MongodbSubscriptionConsumerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private function createMongodbContextMock()
153153
}
154154

155155
/**
156-
* @param null|mixed $queueName
156+
* @param mixed|null $queueName
157157
*
158158
* @return Consumer|\PHPUnit_Framework_MockObject_MockObject
159159
*/

‎pkg/redis/Tests/RedisSubscriptionConsumerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private function createRedisContextMock()
150150
}
151151

152152
/**
153-
* @param null|mixed $queueName
153+
* @param mixed|null $queueName
154154
*
155155
* @return Consumer|\PHPUnit_Framework_MockObject_MockObject
156156
*/

‎pkg/redis/Tests/Spec/JsonSerializerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testThrowIfFailedToEncodeMessageToJson()
4040
{
4141
$serializer = new JsonSerializer();
4242

43-
$resource = fopen(__FILE__, 'rb');
43+
$resource = fopen(__FILE__, 'r');
4444

4545
//guard
4646
$this->assertInternalType('resource', $resource);

‎pkg/sns/Tests/SnsProducerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function testShouldThrowIfPublishFailed()
7272
$context
7373
->expects($this->once())
7474
->method('getSnsClient')
75-
->will($this->returnValue($client))
75+
->willReturn($client)
7676
;
7777

7878
$message = new SnsMessage('foo');
@@ -117,7 +117,7 @@ public function testShouldPublish()
117117
$context
118118
->expects($this->once())
119119
->method('getSnsClient')
120-
->will($this->returnValue($client))
120+
->willReturn($client)
121121
;
122122

123123
$message = new SnsMessage('theBody', ['key' => 'value'], ['hkey' => 'hvaleu']);
@@ -137,7 +137,7 @@ public function testShouldPublishWithMergedAttributes()
137137
$context
138138
->expects($this->once())
139139
->method('getSnsClient')
140-
->will($this->returnValue($client));
140+
->willReturn($client);
141141

142142
$expectedArgument = [
143143
'Message' => 'message',

‎pkg/sqs/Tests/SqsProducerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testShouldThrowIfSendMessageFailed()
6969
$context
7070
->expects($this->once())
7171
->method('getSqsClient')
72-
->will($this->returnValue($client))
72+
->willReturn($client)
7373
;
7474

7575
$destination = new SqsDestination('queue-name');
@@ -116,7 +116,7 @@ public function testShouldSendMessage()
116116
$context
117117
->expects($this->once())
118118
->method('getSqsClient')
119-
->will($this->returnValue($client))
119+
->willReturn($client)
120120
;
121121

122122
$destination = new SqsDestination('queue-name');
@@ -160,7 +160,7 @@ public function testShouldSendMessageWithCustomRegion()
160160
$context
161161
->expects($this->once())
162162
->method('getSqsClient')
163-
->will($this->returnValue($client))
163+
->willReturn($client)
164164
;
165165

166166
$destination = new SqsDestination('queue-name');
@@ -206,7 +206,7 @@ public function testShouldSendDelayedMessage()
206206
$context
207207
->expects($this->once())
208208
->method('getSqsClient')
209-
->will($this->returnValue($client))
209+
->willReturn($client)
210210
;
211211

212212
$destination = new SqsDestination('queue-name');

‎pkg/wamp/Tests/Spec/JsonSerializerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testThrowIfFailedToEncodeMessageToJson()
4040
{
4141
$serializer = new JsonSerializer();
4242

43-
$resource = fopen(__FILE__, 'rb');
43+
$resource = fopen(__FILE__, 'r');
4444

4545
//guard
4646
$this->assertInternalType('resource', $resource);

0 commit comments

Comments
 (0)
Please sign in to comment.