summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/tests/phpunit/Cache/PersistentDatabaseCacheTest.php')
-rw-r--r--MLEB/Translate/tests/phpunit/Cache/PersistentDatabaseCacheTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/MLEB/Translate/tests/phpunit/Cache/PersistentDatabaseCacheTest.php b/MLEB/Translate/tests/phpunit/Cache/PersistentDatabaseCacheTest.php
index db2bfce3..cbb0d984 100644
--- a/MLEB/Translate/tests/phpunit/Cache/PersistentDatabaseCacheTest.php
+++ b/MLEB/Translate/tests/phpunit/Cache/PersistentDatabaseCacheTest.php
@@ -176,6 +176,20 @@ class PersistentDatabaseCacheTest extends MediaWikiIntegrationTestCase {
new PersistentCacheEntry( 'testkey', null, null, $longTestTag );
}
+ public function testExtendGroupExpiryTime() {
+ $tomorrow = ( new DateTime() )->add( new DateInterval( 'P1D' ) );
+ $key = 'hello';
+ $incrementedTime = $tomorrow->getTimestamp() + 100;
+
+ $entry = new PersistentCacheEntry( $key, 'value', $tomorrow->getTimestamp() );
+
+ $this->persistentCache->set( $entry );
+ $this->persistentCache->setExpiry( $key, $incrementedTime );
+
+ $cacheEntry = $this->persistentCache->get( $key );
+ $this->assertEquals( $incrementedTime, $cacheEntry[0]->exptime() );
+ }
+
public function provideTestSet() {
yield [
'keyname' => 'hello',