]> source.dussan.org Git - nextcloud-server.git/commitdiff
ensure commands can be serialized in unit tests
authorRobin Appelman <icewind@owncloud.com>
Tue, 24 Mar 2015 09:46:29 +0000 (10:46 +0100)
committerRobin Appelman <icewind@owncloud.com>
Thu, 26 Mar 2015 16:07:02 +0000 (17:07 +0100)
lib/private/command/queuebus.php

index 953479086ca942481aa19c5ec8f5e16f4a03ba4a..e5604eb1fef2148cea977b9c12b18bf40cf1a97f 100644 (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();
                }