Skip to content

Commit

Permalink
Changes cache duration in forever method for database driver to be in…
Browse files Browse the repository at this point in the history
… line with 5.7
  • Loading branch information
Kristijan Novaković committed Mar 28, 2019
1 parent f1652c7 commit adee424
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/DatabaseStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected function getTime()
*/
public function forever($key, $value)
{
return $this->put($key, $value, 5256000);
return $this->put($key, $value, 315360000);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Cache/CacheDatabaseStoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit adee424

Please sign in to comment.