當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。