本文整理汇总了PHP中Predis\Client::shouldReceive方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::shouldReceive方法的具体用法?PHP Client::shouldReceive怎么用?PHP Client::shouldReceive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Predis\Client
的用法示例。
在下文中一共展示了Client::shouldReceive方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testFlushError
/**
* @expectedException \Exception
*
* @dataProvider kvsProvider
*
* @param KeyValueStore $kvs
* @param RedisAdapter $dummyRedisAdapter
* @param RedisClient $dummyPredis
*/
public function testFlushError(KeyValueStore $kvs, RedisAdapter $dummyRedisAdapter, RedisClient $dummyPredis)
{
$status = new Status('QUEUED');
$dummyPredis->shouldReceive('flushdb')->andReturn($status);
$kvs->flush();
}
示例2: testPersist
/**
* @dataProvider kvsProvider
*
* @param KeyValueStore $kvs
* @param RedisAdapter $dummyRedisAdapter
* @param RedisClient $dummyPredis
*/
public function testPersist(KeyValueStore $kvs, RedisAdapter $dummyRedisAdapter, RedisClient $dummyPredis)
{
$dummyPredis->shouldReceive('persist')->with('key-e')->andReturn(1);
$dummyPredis->shouldReceive('persist')->with('key-ne')->andReturn(0);
$this->assertTrue($kvs->persist('key-e'));
$this->assertFalse($kvs->persist('key-ne'));
}
示例3: tearDown
protected function tearDown()
{
$this->redisClient->shouldReceive('del')->times(1)->andReturn(1);
$this->storage->purgeList($this->fireTime);
}
示例4: testSetError
/**
* @dataProvider kvsProvider
*
* @param KeyValueStore $kvs
* @param RedisAdapter $dummyRedisAdapter
* @param RedisClient $dummyPredis
*/
public function testSetError(KeyValueStore $kvs, RedisAdapter $dummyRedisAdapter, RedisClient $dummyPredis)
{
$status = new Status('QUEUED');
$dummyPredis->shouldReceive('set')->with('key-ne', serialize('value'))->andReturn($status);
$this->assertFalse($kvs->set('key-ne', 'value'));
}