From 58f2480f6b25328e15911b6c9fa5c8627ad76b49 Mon Sep 17 00:00:00 2001 From: Romuald PRIOL Date: Fri, 23 Mar 2018 18:27:00 +0100 Subject: [PATCH] fix rpoplpush, if rpop value is null, not reinsert it. --- src/M6Web/Component/RedisMock/RedisMock.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/M6Web/Component/RedisMock/RedisMock.php b/src/M6Web/Component/RedisMock/RedisMock.php index ecd1db5..fc47653 100644 --- a/src/M6Web/Component/RedisMock/RedisMock.php +++ b/src/M6Web/Component/RedisMock/RedisMock.php @@ -1155,7 +1155,9 @@ public function rpoplpush(string $sourceList, string $destinationList) $rpopValue = $this->rpop($sourceList); // LPUSH (send the value at the end of the $destinationList) - $this->lpush($destinationList, $rpopValue); + if (null !== $rpopValue){ + $this->lpush($destinationList, $rpopValue); + } // return the rpop value; return $rpopValue;