I am using laravel's Bus batch to dispatch jobs, and they use closures that get serialized and un-serialized
public function then($callback)
{
$this->options['then'][] = $callback instanceof Closure
? new SerializableClosure($callback)
: $callback;
return $this;
}
This results in the code coverage marking the then closure as not covered. Is there any workaround to cover such code blocks that get serialized and un-serialized and then are executed?
I am using laravel's Bus batch to dispatch jobs, and they use closures that get serialized and un-serialized
https://laravel.com/docs/11.x/queues#dispatching-batches
Example:
https://github.com/laravel/framework/blob/46ac7829eba556031fa5f540f3771d52fa4117a2/src/Illuminate/Bus/PendingBatch.php#L173
This results in the code coverage marking the then closure as not covered. Is there any workaround to cover such code blocks that get serialized and un-serialized and then are executed?