aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-03-24 10:46:29 +0100
committerRobin Appelman <icewind@owncloud.com>2015-03-26 17:07:02 +0100
commit268f249e8d98e8b91f51f4d39cfc060efbd5caab (patch)
treec72676ae09a9e0c1a48eaf6f1342dc32ce0f06d8
parent176fba83eae36f39b987d1076fbad72be901add0 (diff)
downloadnextcloud-server-268f249e8d98e8b91f51f4d39cfc060efbd5caab.tar.gz
nextcloud-server-268f249e8d98e8b91f51f4d39cfc060efbd5caab.zip
ensure commands can be serialized in unit tests
-rw-r--r--lib/private/command/queuebus.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/command/queuebus.php b/lib/private/command/queuebus.php
index 953479086ca..e5604eb1fef 100644
--- a/lib/private/command/queuebus.php
+++ b/lib/private/command/queuebus.php
@@ -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();
}