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


PHP ServerProfile::getDevelopment方法代码示例

本文整理汇总了PHP中Predis\Profile\ServerProfile::getDevelopment方法的典型用法代码示例。如果您正苦于以下问题:PHP ServerProfile::getDevelopment方法的具体用法?PHP ServerProfile::getDevelopment怎么用?PHP ServerProfile::getDevelopment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Predis\Profile\ServerProfile的用法示例。


在下文中一共展示了ServerProfile::getDevelopment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testGetDevelopment

 /**
  * @group disconnected
  */
 public function testGetDevelopment()
 {
     $profile1 = ServerProfile::get('dev');
     $profile2 = ServerProfile::getDevelopment();
     $this->assertInstanceOf('Predis\\Profile\\ServerProfileInterface', $profile1);
     $this->assertInstanceOf('Predis\\Profile\\ServerProfileInterface', $profile2);
     $this->assertEquals(self::DEVELOPMENT_PROFILE_VERSION, $profile2->getVersion());
 }
开发者ID:ningcaichen,项目名称:laravel-4.1-quick-start-cn,代码行数:11,代码来源:ServerProfileTest.php

示例2: getCommandsQueue

 /**
  * Returns a list of queued command instances.
  *
  * @return SplQueue
  */
 protected function getCommandsQueue()
 {
     $profile = ServerProfile::getDevelopment();
     $pipeline = new SplQueue();
     $pipeline->enqueue($profile->createCommand('ping'));
     $pipeline->enqueue($profile->createCommand('ping'));
     $pipeline->enqueue($profile->createCommand('ping'));
     return $pipeline;
 }
开发者ID:GeorgeBroadley,项目名称:caffeine-vendor,代码行数:14,代码来源:FireAndForgetExecutorTest.php

示例3: testSetLuaScriptAsReadOperation

 /**
  * @group disconnected
  */
 public function testSetLuaScriptAsReadOperation()
 {
     $strategy = new ReplicationStrategy();
     $profile = ServerProfile::getDevelopment();
     $writeScript = 'redis.call("set", "foo", "bar")';
     $readScript = 'return true';
     $strategy->setScriptReadOnly($readScript, true);
     $cmdEval = $profile->createCommand('EVAL', array($writeScript));
     $cmdEvalSHA = $profile->createCommand('EVALSHA', array(sha1($writeScript)));
     $this->assertFalse($strategy->isReadOperation($cmdEval));
     $this->assertFalse($strategy->isReadOperation($cmdEvalSHA));
     $cmdEval = $profile->createCommand('EVAL', array($readScript));
     $cmdEvalSHA = $profile->createCommand('EVALSHA', array(sha1($readScript)));
     $this->assertTrue($strategy->isReadOperation($cmdEval));
     $this->assertTrue($strategy->isReadOperation($cmdEvalSHA));
 }
开发者ID:Thomvh,项目名称:turbine,代码行数:19,代码来源:ReplicationStrategyTest.php

示例4: testSettingCustomCommandHandler

 /**
  * @group disconnected
  */
 public function testSettingCustomCommandHandler()
 {
     $strategy = $this->getHashStrategy();
     $profile = ServerProfile::getDevelopment();
     $callable = $this->getMock('stdClass', array('__invoke'));
     $callable->expects($this->once())->method('__invoke')->with($this->isInstanceOf('Predis\\Command\\CommandInterface'))->will($this->returnValue('key'));
     $strategy->setCommandHandler('get', $callable);
     $command = $profile->createCommand('get', array('key'));
     $this->assertNotNull($strategy->getHash($command));
 }
开发者ID:ningcaichen,项目名称:laravel-4.1-quick-start-cn,代码行数:13,代码来源:PredisClusterHashStrategyTest.php


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