Adding tests for non latin domains to MemcacheEngine. Closes #1143

This commit is contained in:
mark_story 2010-09-26 12:04:06 -04:00
parent 995a14c140
commit 0990728385

View file

@ -20,6 +20,20 @@
if (!class_exists('Cache')) {
require LIBS . 'cache.php';
}
App::import('Core', 'cache/Memcache');
class TestMemcacheEngine extends MemcacheEngine {
/**
* public accessor to _parseServerString
*
* @param string $server
* @return array
*/
function parseServerString($server) {
return $this->_parseServerString($server);
}
}
/**
* MemcacheEngineTest class
@ -152,6 +166,20 @@ class MemcacheEngineTest extends CakeTestCase {
$this->assertTrue($result);
}
/**
* test non latin domains.
*
* @return void
*/
function testParseServerStringNonLatin() {
$Memcache =& new TestMemcacheEngine();
$result = $Memcache->parseServerString('schülervz.net:13211');
$this->assertEqual($result, array('schülervz.net', '13211'));
$result = $Memcache->parseServerString('sülül:1111');
$this->assertEqual($result, array('sülül', '1111'));
}
/**
* testReadAndWriteCache method
*