Skip to content

Commit e82f972

Browse files
Expand single-line array into multiline (#57350)
1 parent 1afa280 commit e82f972

File tree

1 file changed

+60
-10
lines changed

1 file changed

+60
-10
lines changed

tests/Queue/QueueSqsQueueTest.php

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,12 @@ public function testPushProperlyPushesJobStringOntoSqsFifoQueue()
327327
$queue->setContainer($container = m::spy(Container::class));
328328
$queue->expects($this->once())->method('createPayload')->with($this->mockedJob, $this->fifoQueueName, $this->mockedData)->willReturn($this->mockedPayload);
329329
$queue->expects($this->once())->method('getQueue')->with($this->fifoQueueName)->willReturn($this->fifoQueueUrl);
330-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->fifoQueueName, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
330+
$this->sqs->shouldReceive('sendMessage')->once()->with([
331+
'QueueUrl' => $this->fifoQueueUrl,
332+
'MessageBody' => $this->mockedPayload,
333+
'MessageGroupId' => $this->fifoQueueName,
334+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
335+
])->andReturn($this->mockedSendMessageResponseModel);
331336
$id = $queue->push($this->mockedJob, $this->mockedData, $this->fifoQueueName);
332337
$this->assertEquals($this->mockedMessageId, $id);
333338
$container->shouldHaveReceived('bound')->with('events')->twice();
@@ -345,7 +350,12 @@ public function testPushProperlyPushesJobObjectOntoSqsFifoQueue()
345350
$queue->setContainer($container = m::spy(Container::class));
346351
$queue->expects($this->once())->method('createPayload')->with($job, $this->fifoQueueName, $this->mockedData)->willReturn($this->mockedPayload);
347352
$queue->expects($this->once())->method('getQueue')->with($this->fifoQueueName)->willReturn($this->fifoQueueUrl);
348-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->mockedMessageGroupId, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
353+
$this->sqs->shouldReceive('sendMessage')->once()->with([
354+
'QueueUrl' => $this->fifoQueueUrl,
355+
'MessageBody' => $this->mockedPayload,
356+
'MessageGroupId' => $this->mockedMessageGroupId,
357+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
358+
])->andReturn($this->mockedSendMessageResponseModel);
349359
$id = $queue->push($job, $this->mockedData, $this->fifoQueueName);
350360
$this->assertEquals($this->mockedMessageId, $id);
351361
$container->shouldHaveReceived('bound')->with('events')->twice();
@@ -363,7 +373,12 @@ public function testPushProperlyPushesJobObjectOntoSqsFifoQueueWithDeduplication
363373
$queue->setContainer($container = m::spy(Container::class));
364374
$queue->expects($this->once())->method('createPayload')->with($job, $this->fifoQueueName, $this->mockedData)->willReturn($this->mockedPayload);
365375
$queue->expects($this->once())->method('getQueue')->with($this->fifoQueueName)->willReturn($this->fifoQueueUrl);
366-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->mockedMessageGroupId, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
376+
$this->sqs->shouldReceive('sendMessage')->once()->with([
377+
'QueueUrl' => $this->fifoQueueUrl,
378+
'MessageBody' => $this->mockedPayload,
379+
'MessageGroupId' => $this->mockedMessageGroupId,
380+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
381+
])->andReturn($this->mockedSendMessageResponseModel);
367382
$id = $queue->push($job, $this->mockedData, $this->fifoQueueName);
368383
$this->assertEquals($this->mockedMessageId, $id);
369384
$container->shouldHaveReceived('bound')->with('events')->twice();
@@ -386,7 +401,12 @@ public function testPushProperlyPushesJobObjectOntoSqsFifoQueueWithDeduplicator(
386401
$queue->setContainer($container = m::spy(Container::class));
387402
$queue->expects($this->once())->method('createPayload')->with($job, $this->fifoQueueName, $this->mockedData)->willReturn($this->mockedPayload);
388403
$queue->expects($this->once())->method('getQueue')->with($this->fifoQueueName)->willReturn($this->fifoQueueUrl);
389-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->mockedMessageGroupId, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
404+
$this->sqs->shouldReceive('sendMessage')->once()->with([
405+
'QueueUrl' => $this->fifoQueueUrl,
406+
'MessageBody' => $this->mockedPayload,
407+
'MessageGroupId' => $this->mockedMessageGroupId,
408+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
409+
])->andReturn($this->mockedSendMessageResponseModel);
390410
$id = $queue->push($job, $this->mockedData, $this->fifoQueueName);
391411
$this->assertEquals($this->mockedMessageId, $id);
392412
$container->shouldHaveReceived('bound')->with('events')->twice();
@@ -402,7 +422,12 @@ public function testPendingDispatchProperlyPushesJobObjectOntoSqsFifoQueue()
402422
$queue->setContainer($container = m::spy(Container::class));
403423
$queue->expects($this->once())->method('createPayload')->with($pendingDispatch->getJob(), $this->fifoQueueName, '')->willReturn($this->mockedPayload);
404424
$queue->expects($this->once())->method('getQueue')->with(null)->willReturn($this->fifoQueueUrl);
405-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->mockedMessageGroupId, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
425+
$this->sqs->shouldReceive('sendMessage')->once()->with([
426+
'QueueUrl' => $this->fifoQueueUrl,
427+
'MessageBody' => $this->mockedPayload,
428+
'MessageGroupId' => $this->mockedMessageGroupId,
429+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
430+
])->andReturn($this->mockedSendMessageResponseModel);
406431

407432
$dispatcher = new Dispatcher($container, fn () => $queue);
408433
app()->instance(DispatcherContract::class, $dispatcher);
@@ -425,7 +450,12 @@ public function testPendingDispatchProperlyPushesJobObjectOntoSqsFifoQueueWithDe
425450
$queue->setContainer($container = m::spy(Container::class));
426451
$queue->expects($this->once())->method('createPayload')->with($pendingDispatch->getJob(), $this->fifoQueueName, '')->willReturn($this->mockedPayload);
427452
$queue->expects($this->once())->method('getQueue')->with(null)->willReturn($this->fifoQueueUrl);
428-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->mockedMessageGroupId, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
453+
$this->sqs->shouldReceive('sendMessage')->once()->with([
454+
'QueueUrl' => $this->fifoQueueUrl,
455+
'MessageBody' => $this->mockedPayload,
456+
'MessageGroupId' => $this->mockedMessageGroupId,
457+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
458+
])->andReturn($this->mockedSendMessageResponseModel);
429459

430460
$dispatcher = new Dispatcher($container, fn () => $queue);
431461
app()->instance(DispatcherContract::class, $dispatcher);
@@ -457,7 +487,12 @@ public function testPendingDispatchProperlyPushesJobObjectOntoSqsFifoQueueWithDe
457487
$queue->setContainer($container = m::spy(Container::class));
458488
$queue->expects($this->once())->method('createPayload')->with($pendingDispatch->getJob(), $this->fifoQueueName, '')->willReturn($this->mockedPayload);
459489
$queue->expects($this->once())->method('getQueue')->with(null)->willReturn($this->fifoQueueUrl);
460-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->mockedMessageGroupId, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
490+
$this->sqs->shouldReceive('sendMessage')->once()->with([
491+
'QueueUrl' => $this->fifoQueueUrl,
492+
'MessageBody' => $this->mockedPayload,
493+
'MessageGroupId' => $this->mockedMessageGroupId,
494+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
495+
])->andReturn($this->mockedSendMessageResponseModel);
461496

462497
$dispatcher = new Dispatcher($container, fn () => $queue);
463498
app()->instance(DispatcherContract::class, $dispatcher);
@@ -515,7 +550,12 @@ public function testDelayedPushProperlyPushesJobStringOntoSqsFifoQueueWithoutDel
515550
$queue->expects($this->once())->method('createPayload')->with($this->mockedJob, $this->fifoQueueName, $this->mockedData)->willReturn($this->mockedPayload);
516551
$queue->expects($this->never())->method('secondsUntil')->with($this->mockedDelay)->willReturn($this->mockedDelay);
517552
$queue->expects($this->once())->method('getQueue')->with($this->fifoQueueName)->willReturn($this->fifoQueueUrl);
518-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->fifoQueueName, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
553+
$this->sqs->shouldReceive('sendMessage')->once()->with([
554+
'QueueUrl' => $this->fifoQueueUrl,
555+
'MessageBody' => $this->mockedPayload,
556+
'MessageGroupId' => $this->fifoQueueName,
557+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
558+
])->andReturn($this->mockedSendMessageResponseModel);
519559
$id = $queue->later($this->mockedDelay, $this->mockedJob, $this->mockedData, $this->fifoQueueName);
520560
$this->assertEquals($this->mockedMessageId, $id);
521561
$container->shouldHaveReceived('bound')->with('events')->twice();
@@ -534,7 +574,12 @@ public function testDelayedPushProperlyPushesJobObjectOntoSqsFifoQueueWithoutDel
534574
$queue->expects($this->once())->method('createPayload')->with($job, $this->fifoQueueName, $this->mockedData)->willReturn($this->mockedPayload);
535575
$queue->expects($this->never())->method('secondsUntil')->with($this->mockedDelay)->willReturn($this->mockedDelay);
536576
$queue->expects($this->once())->method('getQueue')->with($this->fifoQueueName)->willReturn($this->fifoQueueUrl);
537-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->mockedMessageGroupId, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
577+
$this->sqs->shouldReceive('sendMessage')->once()->with([
578+
'QueueUrl' => $this->fifoQueueUrl,
579+
'MessageBody' => $this->mockedPayload,
580+
'MessageGroupId' => $this->mockedMessageGroupId,
581+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
582+
])->andReturn($this->mockedSendMessageResponseModel);
538583
$id = $queue->later($this->mockedDelay, $job, $this->mockedData, $this->fifoQueueName);
539584
$this->assertEquals($this->mockedMessageId, $id);
540585
$container->shouldHaveReceived('bound')->with('events')->twice();
@@ -552,7 +597,12 @@ public function testDelayedPendingDispatchProperlyPushesJobObjectOntoSqsFifoQueu
552597
$queue->setContainer($container = m::spy(Container::class));
553598
$queue->expects($this->once())->method('createPayload')->with($pendingDispatch->getJob(), $this->fifoQueueName, '')->willReturn($this->mockedPayload);
554599
$queue->expects($this->once())->method('getQueue')->with(null)->willReturn($this->fifoQueueUrl);
555-
$this->sqs->shouldReceive('sendMessage')->once()->with(['QueueUrl' => $this->fifoQueueUrl, 'MessageBody' => $this->mockedPayload, 'MessageGroupId' => $this->mockedMessageGroupId, 'MessageDeduplicationId' => $this->mockedDeduplicationId])->andReturn($this->mockedSendMessageResponseModel);
600+
$this->sqs->shouldReceive('sendMessage')->once()->with([
601+
'QueueUrl' => $this->fifoQueueUrl,
602+
'MessageBody' => $this->mockedPayload,
603+
'MessageGroupId' => $this->mockedMessageGroupId,
604+
'MessageDeduplicationId' => $this->mockedDeduplicationId,
605+
])->andReturn($this->mockedSendMessageResponseModel);
556606

557607
$dispatcher = new Dispatcher($container, fn () => $queue);
558608
app()->instance(DispatcherContract::class, $dispatcher);

0 commit comments

Comments
 (0)