Skip to content

Commit e3e8d58

Browse files
committed
Merge branch '5.5' of github.com:laravel/framework into 5.5
2 parents 47483c0 + 87d64cd commit e3e8d58

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/Illuminate/Cache/Repository.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public function put($key, $value, $minutes = null)
199199
*/
200200
public function set($key, $value, $ttl = null)
201201
{
202-
$this->put($key, $value, $ttl);
202+
$this->put($key, $value, is_int($ttl) ? $ttl / 60 : null);
203203
}
204204

205205
/**
@@ -225,7 +225,7 @@ public function putMany(array $values, $minutes)
225225
*/
226226
public function setMultiple($values, $ttl = null)
227227
{
228-
$this->putMany(is_array($values) ? $values : iterator_to_array($values), $ttl);
228+
$this->putMany(is_array($values) ? $values : iterator_to_array($values), is_int($ttl) ? $ttl / 60 : null);
229229
}
230230

231231
/**

tests/Cache/CacheRepositoryTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,18 +116,16 @@ public function testPuttingMultipleItemsInCache()
116116

117117
public function testSettingMultipleItemsInCacheArray()
118118
{
119-
// Alias of PuttingMultiple
120119
$repo = $this->getRepository();
121120
$repo->getStore()->shouldReceive('putMany')->once()->with(['foo' => 'bar', 'bar' => 'baz'], 1);
122-
$repo->setMultiple(['foo' => 'bar', 'bar' => 'baz'], 1);
121+
$repo->setMultiple(['foo' => 'bar', 'bar' => 'baz'], 60);
123122
}
124123

125124
public function testSettingMultipleItemsInCacheIterator()
126125
{
127-
// Alias of PuttingMultiple
128126
$repo = $this->getRepository();
129127
$repo->getStore()->shouldReceive('putMany')->once()->with(['foo' => 'bar', 'bar' => 'baz'], 1);
130-
$repo->setMultiple(new ArrayIterator(['foo' => 'bar', 'bar' => 'baz']), 1);
128+
$repo->setMultiple(new ArrayIterator(['foo' => 'bar', 'bar' => 'baz']), 60);
131129
}
132130

133131
public function testPutWithDatetimeInPastOrZeroSecondsDoesntSaveItem()
@@ -210,7 +208,7 @@ public function testSettingCache()
210208
{
211209
$repo = $this->getRepository();
212210
$repo->getStore()->shouldReceive('put')->with($key = 'foo', $value = 'bar', 1);
213-
$repo->set($key, $value, 1);
211+
$repo->set($key, $value, 60);
214212
}
215213

216214
public function testClearingWholeCache()

0 commit comments

Comments
 (0)