mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Add tests for cacheMethodHasher
This commit is contained in:
parent
e186ffc6d3
commit
7ffb5c3600
1 changed files with 28 additions and 0 deletions
|
@ -737,6 +737,34 @@ class DboSourceTest extends CakeTestCase {
|
||||||
$this->assertNull($result);
|
$this->assertNull($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that cacheMethodHasher uses md5 by default.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testCacheMethodHasher() {
|
||||||
|
$name = 'Model.fieldlbqndkezcoapfgirmjsh';
|
||||||
|
$actual = $this->testDb->cacheMethodHasher($name);
|
||||||
|
$expected = '4a45dc9ed52f98c393d04ac424ee5078';
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $actual);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that cacheMethodHasher can be overridden to use a different hashing algorithm.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testCacheMethodHasherOverridden() {
|
||||||
|
$testDb = new DboThirdTestSource();
|
||||||
|
|
||||||
|
$name = 'Model.fieldlbqndkezcoapfgirmjsh';
|
||||||
|
$actual = $testDb->cacheMethodHasher($name);
|
||||||
|
$expected = 'f4441bb8fcbe0944';
|
||||||
|
|
||||||
|
$this->assertEquals($expected, $actual);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test that rare collisions do not happen with method caching
|
* Test that rare collisions do not happen with method caching
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue