当前位置: 首页>>代码示例>>PHP>>正文


PHP Client::shouldReceive方法代码示例

本文整理汇总了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();
 }
开发者ID:adammbalogh,项目名称:key-value-store-redis,代码行数:15,代码来源:ServerTraitTest.php

示例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'));
 }
开发者ID:adammbalogh,项目名称:key-value-store-redis,代码行数:14,代码来源:KeyTraitTest.php

示例3: tearDown

 protected function tearDown()
 {
     $this->redisClient->shouldReceive('del')->times(1)->andReturn(1);
     $this->storage->purgeList($this->fireTime);
 }
开发者ID:jiangyu7408,项目名称:notification,代码行数:5,代码来源:RedisStorageTest.php

示例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'));
 }
开发者ID:adammbalogh,项目名称:key-value-store-redis,代码行数:13,代码来源:ValueTraitTest.php


注:本文中的Predis\Client::shouldReceive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。