From b452e18ebc2a14be264472d50510bb18e760a18d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Sun, 25 Oct 2020 19:00:57 +0100 Subject: [PATCH] Fix transient tests --- .../Component/Cache/Tests/Adapter/AdapterTestCase.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php b/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php index 05b863d1ac..57c355eaa4 100644 --- a/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php +++ b/src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php @@ -116,11 +116,11 @@ abstract class AdapterTestCase extends CachePoolTest $item = $cache->getItem('foo'); - $expected = [ - CacheItem::METADATA_EXPIRY => 9.5 + time(), - CacheItem::METADATA_CTIME => 1000, - ]; - $this->assertEqualsWithDelta($expected, $item->getMetadata(), .6, 'Item metadata should embed expiry and ctime.'); + $metadata = $item->getMetadata(); + $this->assertArrayHasKey(CacheItem::METADATA_CTIME, $metadata); + $this->assertEqualsWithDelta(1000, $metadata[CacheItem::METADATA_CTIME], 6); + $this->assertArrayHasKey(CacheItem::METADATA_EXPIRY, $metadata); + $this->assertEqualsWithDelta(9.5 + time(), $metadata[CacheItem::METADATA_EXPIRY], 0.6); } public function testDefaultLifeTime()