@@ -676,13 +676,13 @@ public function testCanSerializeAndRestoreCommands($commandFunctionName, $assert
676
676
677
677
// without setting the serialization, the job should return the value passed in
678
678
$ this ->fake ->{$ commandFunctionName }(new BusFakeJobWithSerialization ('hello ' ));
679
- $ this ->fake ->{$ assertionFunctionName }(BusFakeJobWithSerialization::class, fn ($ command ) => $ command ->value === 'hello ' );
679
+ $ this ->fake ->{$ assertionFunctionName }(BusFakeJobWithSerialization::class, fn ($ command ) => $ command ->value === 'hello ' );
680
680
681
681
// when enabling the serializeAndRestore property, job has value modified
682
682
$ serializingBusFake ->{$ commandFunctionName }(new BusFakeJobWithSerialization ('hello ' ));
683
683
$ serializingBusFake ->{$ assertionFunctionName }(
684
684
BusFakeJobWithSerialization::class,
685
- fn ($ command ) => $ command ->value === 'hello-serialized-unserialized '
685
+ fn ($ command ) => $ command ->value === 'hello-serialized-unserialized '
686
686
);
687
687
}
688
688
@@ -704,7 +704,7 @@ public function testCanSerializeAndRestoreCommandsInBatch()
704
704
$ this ->fake ->batch ([
705
705
new BusFakeJobWithSerialization ('hello ' ),
706
706
])->dispatch ();
707
- $ this ->fake ->assertBatched (function (PendingBatchFake $ batchedCollection ) {
707
+ $ this ->fake ->assertBatched (function (PendingBatchFake $ batchedCollection ) {
708
708
return $ batchedCollection ->jobs ->count () === 1 && $ batchedCollection ->jobs ->first ()->value === 'hello ' ;
709
709
});
710
710
@@ -713,7 +713,7 @@ public function testCanSerializeAndRestoreCommandsInBatch()
713
713
new BusFakeJobWithSerialization ('hello ' ),
714
714
])->dispatch ();
715
715
716
- $ serializingBusFake ->assertBatched (function (PendingBatchFake $ batchedCollection ) {
716
+ $ serializingBusFake ->assertBatched (function (PendingBatchFake $ batchedCollection ) {
717
717
return $ batchedCollection ->jobs ->count () === 1 && $ batchedCollection ->jobs ->first ()->value === 'hello ' ;
718
718
});
719
719
}
@@ -744,7 +744,6 @@ class ThirdJob
744
744
//
745
745
}
746
746
747
-
748
747
class BusFakeJobWithSerialization
749
748
{
750
749
use Queueable;
@@ -755,11 +754,11 @@ public function __construct(public $value)
755
754
756
755
public function __serialize (): array
757
756
{
758
- return ['value ' => $ this ->value .'-serialized ' ];
757
+ return ['value ' => $ this ->value .'-serialized ' ];
759
758
}
760
759
761
760
public function __unserialize (array $ data ): void
762
761
{
763
- $ this ->value = $ data ['value ' ] .'-unserialized ' ;
762
+ $ this ->value = $ data ['value ' ].'-unserialized ' ;
764
763
}
765
764
}
0 commit comments