From adee424af38e82c7de18a9e4ff47d069a04e8c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristijan=20Novakovi=C4=87?= Date: Thu, 28 Mar 2019 14:55:40 +0100 Subject: [PATCH] Changes cache duration in forever method for database driver to be in line with 5.7 --- src/Illuminate/Cache/DatabaseStore.php | 2 +- tests/Cache/CacheDatabaseStoreTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Illuminate/Cache/DatabaseStore.php b/src/Illuminate/Cache/DatabaseStore.php index e5c7cd146748..a7de61bb1e86 100755 --- a/src/Illuminate/Cache/DatabaseStore.php +++ b/src/Illuminate/Cache/DatabaseStore.php @@ -202,7 +202,7 @@ protected function getTime() */ public function forever($key, $value) { - return $this->put($key, $value, 5256000); + return $this->put($key, $value, 315360000); } /** diff --git a/tests/Cache/CacheDatabaseStoreTest.php b/tests/Cache/CacheDatabaseStoreTest.php index 70de8175ebf5..608be4a6b241 100755 --- a/tests/Cache/CacheDatabaseStoreTest.php +++ b/tests/Cache/CacheDatabaseStoreTest.php @@ -106,7 +106,7 @@ public function testValueIsInsertedOnPostgres() public function testForeverCallsStoreItemWithReallyLongTime() { $store = $this->getMockBuilder(DatabaseStore::class)->setMethods(['put'])->setConstructorArgs($this->getMocks())->getMock(); - $store->expects($this->once())->method('put')->with($this->equalTo('foo'), $this->equalTo('bar'), $this->equalTo(5256000))->willReturn(true); + $store->expects($this->once())->method('put')->with($this->equalTo('foo'), $this->equalTo('bar'), $this->equalTo(315360000))->willReturn(true); $result = $store->forever('foo', 'bar'); $this->assertTrue($result); }