Skip to content

Commit

Permalink
Cache: Ignore test of weight
Browse files Browse the repository at this point in the history
Memcached::getServerList() result may not contains 'weight', see
@link php-memcached-dev/php-memcached#56
  • Loading branch information
fwolf committed Nov 12, 2014
1 parent a838424 commit 075b41c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Fwlib/Cache/Test/CacheMemcachedTest.php
Expand Up @@ -50,18 +50,21 @@ public function testCache()
);
$this->ch->setConfigServer($x);
$this->ch->get('any key');
$this->assertEqualArray(
array($y),
$this->reflectionGet($this->ch, 'memcached')->getServerList()
);
$serverList = $this->reflectionGet($this->ch, 'memcached')
->getServerList();
// Memcached::getServerList() result may not include weight
$this->assertEquals($y['host'], $serverList[0]['host']);
$this->assertEquals($y['port'], $serverList[0]['port']);


// Set server cfg, writable, $memcached is reset to null now
$this->ch->setConfigServer($ms);
// Do an operate to trigger memcached instance creation
$this->ch->get('any key');
$ar = $this->reflectionGet($this->ch, 'memcached')->getServerList();
$this->assertEquals($ar, $ms);
$serverList = $this->reflectionGet($this->ch, 'memcached')
->getServerList();
$this->assertEquals($ms[0]['host'], $serverList[0]['host']);
$this->assertEquals($ms[0]['port'], $serverList[0]['port']);


// Cache write
Expand Down

0 comments on commit 075b41c

Please sign in to comment.