本文整理汇总了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());
}
示例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;
}
示例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));
}
示例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));
}