<?phprequire_oncedirname(__FILE__).'/CredisClusterTest.php';classCredisStandaloneClusterTestextendsCredisClusterTest{protected$useStandalone=TRUE;protectedfunctiontearDown(){if($this->cluster){foreach($this->cluster->clients()as$client){if($client->isConnected()){$client->close();}}$this->cluster=NULL;}}publicfunctiontestMasterSlave(){$this->tearDown();$this->cluster=newCredis_Cluster(array($this->redisConfig[0],$this->redisConfig[6]),2,$this->useStandalone);$this->assertTrue($this->cluster->client('master')->set('key','value'));$this->waitForSlaveReplication();$this->assertEquals('value',$this->cluster->client('slave')->get('key'));$this->assertEquals('value',$this->cluster->get('key'));$this->setExpectedExceptionShim('CredisException','READONLY You can\'t write against a read only slave.');$this->cluster->client('slave')->set('key2','value');}}