objectcache: fix failing tests for non-HashBagOStuff backends
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 26 Jul 2019 19:33:40 +0000 (15:33 -0400)
committerKrinkle <krinklemail@gmail.com>
Wed, 7 Aug 2019 14:07:22 +0000 (14:07 +0000)
commit88640fd9029008a864fe9f342b58d665a5342871
tree2289bcadbba81985c0c2a9760e9641535b908530
parentc793bcece4afbdc43f424ed45c28cc31e09a16dd
objectcache: fix failing tests for non-HashBagOStuff backends

Use real time for testing absolute expirations with changeTTL().
Otherwise, backends like memcached or redis will fail since
they do not use the mock time.

Also:
* Make SqlBagOStuff actually override changeTTLMulti() by
  using the right method name
* Check TTL_INDEFINITE more explicitly for clarity
* Rename TTL conversion methods for clarity
* Use isRelativeExpiration() in MemcachedBagOStuff

Change-Id: I9365ceb31d4e7bef65906363d42b8c3020a66346
includes/libs/objectcache/BagOStuff.php
includes/libs/objectcache/HashBagOStuff.php
includes/libs/objectcache/MediumSpecificBagOStuff.php
includes/libs/objectcache/MemcachedBagOStuff.php
includes/libs/objectcache/RedisBagOStuff.php
includes/objectcache/SqlBagOStuff.php
tests/phpunit/includes/libs/objectcache/BagOStuffTest.php