ensure commands can be serialized in unit tests

This commit is contained in:
Robin Appelman 2015-03-24 10:46:29 +01:00
parent 176fba83ea
commit 268f249e8d

View file

@ -39,7 +39,10 @@ class QueueBus implements IBus {
*/
private function runCommand($command) {
if ($command instanceof ICommand) {
$command->handle();
// ensure the command can be serialized
$serialized = serialize($command);
$unserialized = unserialize($serialized);
$unserialized->handle();
} else {
$command();
}