[NFC] Remove timecop function references from Cache Tiered Test
authorSeamus Lee <seamuslee001@gmail.com>
Tue, 18 May 2021 22:38:08 +0000 (08:38 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Tue, 18 May 2021 22:38:08 +0000 (08:38 +1000)
tests/phpunit/E2E/Cache/TieredTest.php

index a68900238ff3daa870adcaa308a139085bd678d7..bcff556417f16185904602264f6f3f32bb30873a 100644 (file)
@@ -27,13 +27,6 @@ class E2E_Cache_TieredTest extends E2E_Cache_CacheTestCase {
    */
   protected $b;
 
-  protected function tearDown(): void {
-    if (function_exists('timecop_return')) {
-      timecop_return();
-    }
-    parent::tearDown();
-  }
-
   public function createSimpleCache($maxTimeouts = [86400]) {
     return new CRM_Utils_Cache_Tiered([
       $this->a = CRM_Utils_Cache::create([
@@ -170,7 +163,7 @@ class E2E_Cache_TieredTest extends E2E_Cache_CacheTestCase {
     $this->assertApproxEquals(NULL, $this->a->getExpires('foo'), self::TOLERANCE);
     $this->assertApproxEquals($start + 1000, $this->b->getExpires('foo'), self::TOLERANCE);
 
-    function_exists('timecop_return') ? timecop_travel(time() + self::TOLERANCE) : sleep(self::TOLERANCE);
+    sleep(self::TOLERANCE);
 
     $this->assertEquals('bar', $this->cache->get('foo'));
     $this->assertApproxEquals($start + 100 + self::TOLERANCE, $this->a->getExpires('foo'), self::TOLERANCE);