mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding tests for non latin domains to MemcacheEngine. Closes #1143
This commit is contained in:
parent
995a14c140
commit
0990728385
1 changed files with 28 additions and 0 deletions
28
cake/tests/cases/libs/cache/memcache.test.php
vendored
28
cake/tests/cases/libs/cache/memcache.test.php
vendored
|
@ -20,6 +20,20 @@
|
||||||
if (!class_exists('Cache')) {
|
if (!class_exists('Cache')) {
|
||||||
require LIBS . 'cache.php';
|
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
|
* MemcacheEngineTest class
|
||||||
|
@ -152,6 +166,20 @@ class MemcacheEngineTest extends CakeTestCase {
|
||||||
$this->assertTrue($result);
|
$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
|
* testReadAndWriteCache method
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue