From 71745f4f9d3e14f240a32ebffcddf379f807926e Mon Sep 17 00:00:00 2001 From: Kevin Ullyott Date: Thu, 1 Oct 2020 15:03:09 -0700 Subject: [PATCH] Use test job classes to fix seralization issue Signed-off-by: Kevin Ullyott --- tests/Bus/BusBatchTest.php | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/tests/Bus/BusBatchTest.php b/tests/Bus/BusBatchTest.php index 9a5d2c47f9ba..c58d87473ca2 100644 --- a/tests/Bus/BusBatchTest.php +++ b/tests/Bus/BusBatchTest.php @@ -311,17 +311,11 @@ public function test_chain_can_be_added_to_batch() $batch = $this->createTestBatch($queue); - $chainHeadJob = new class implements ShouldQueue { - use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, Batchable; - }; + $chainHeadJob = new ChainHeadJob(); - $secondJob = new class implements ShouldQueue { - use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, Batchable; - }; + $secondJob = new SecondTestJob(); - $thirdJob = new class implements ShouldQueue { - use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, Batchable; - }; + $thirdJob = new ThirdTestJob(); $queue->shouldReceive('connection')->once() ->with('test-connection') @@ -391,3 +385,18 @@ protected function schema() return $this->connection()->getSchemaBuilder(); } } + +class ChainHeadJob implements ShouldQueue +{ + use Dispatchable, Queueable, Batchable; +} + +class SecondTestJob implements ShouldQueue +{ + use Dispatchable, Queueable, Batchable; +} + +class ThirdTestJob implements ShouldQueue +{ + use Dispatchable, Queueable, Batchable; +}