From 67294a3a5ff7a3e878baf13cacf1956e71136a61 Mon Sep 17 00:00:00 2001 From: Victor Pryazhnikov Date: Sat, 27 Feb 2021 15:18:06 +0300 Subject: [PATCH] Fix of Predis\Client mock creation Predis\Client uses __call method to process commands (rPush, lTrim), getPartialMock() doesn't work with addMethods() --- tests/Monolog/Handler/RedisHandlerTest.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/Monolog/Handler/RedisHandlerTest.php b/tests/Monolog/Handler/RedisHandlerTest.php index b6cc8524..7ee409a1 100644 --- a/tests/Monolog/Handler/RedisHandlerTest.php +++ b/tests/Monolog/Handler/RedisHandlerTest.php @@ -109,7 +109,10 @@ class RedisHandlerTest extends TestCase { $redis = $this->createPartialMock('Predis\Client', ['transaction']); - $redisTransaction = $this->createPartialMock('Predis\Client', ['rPush', 'lTrim']); + $redisTransaction = $this->getMockBuilder('Predis\Client') + ->disableOriginalConstructor() + ->addMethods(['rPush', 'lTrim']) + ->getMock(); $redisTransaction->expects($this->once()) ->method('rPush')