mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 13:46:38 +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:
@@ -109,7 +109,10 @@ class RedisHandlerTest extends TestCase
|
|||||||
{
|
{
|
||||||
$redis = $this->createPartialMock('Predis\Client', ['transaction']);
|
$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())
|
$redisTransaction->expects($this->once())
|
||||||
->method('rPush')
|
->method('rPush')
|
||||||
|
Reference in New Issue
Block a user