1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-06 13:16:39 +02:00

Fix of Predis\Client mock creation

Predis\Client uses __call method to process commands (rPush, lTrim),
getPartialMock() doesn't work with addMethods()
This commit is contained in:
Victor Pryazhnikov
2021-02-27 15:18:06 +03:00
parent 227343f20b
commit 67294a3a5f

View File

@@ -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')