objectcache: Improve WANObjectCache test coverage
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 25 Sep 2017 23:21:40 +0000 (00:21 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Mon, 25 Sep 2017 23:22:23 +0000 (00:22 +0100)
commit71f7b56520148dc7f9c224cb1a4be822f3d8ec63
treef3da47b9db5f268324d5c491dd0f7892e87d4de0
parent0fde1a516fe5124ae3d3ba09943b46ec6d18be03
objectcache: Improve WANObjectCache test coverage

class WANObjectCache (methods: 30% -> 40%, lines: 62% -> 65%)

* doGetWithSetCallback: 98% -> 100%
 - Add case: Throw for invalid callback.
* getWithSetCallback: 86% -> 100%
 - Cover case: Else branch for `$cur[self::VFLD_VERSION] === $version`.
* getMulti: 91% -> 98%
 - Cover case: If branch for `$this->warmupCache`.
* set: 93% -> 100%
 - Cover case: If branch for `lockTSE >= 0`.
* reap: 84% -> 100%
 - Add case: Error when changeTTL() fails.

Change-Id: I4844ab0ebdd4d3ec9acc9cd4500721b04cfda317
tests/phpunit/includes/libs/objectcache/WANObjectCacheTest.php