check limit of serialized command in unit tests
This commit is contained in:
parent
268f249e8d
commit
8c903c100f
|
@ -41,6 +41,9 @@ class QueueBus implements IBus {
|
|||
if ($command instanceof ICommand) {
|
||||
// ensure the command can be serialized
|
||||
$serialized = serialize($command);
|
||||
if(strlen($serialized) > 4000) {
|
||||
throw new \InvalidArgumentException('Trying to push a command which serialized form can not be stored in the database (>4000 character)');
|
||||
}
|
||||
$unserialized = unserialize($serialized);
|
||||
$unserialized->handle();
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue