Skip to content

Commit 4bbfd9a

Browse files
committed
v2.12.x: Fixed expiration to be in seconds.
1 parent 8f05706 commit 4bbfd9a

File tree

5 files changed

+8
-47
lines changed

5 files changed

+8
-47
lines changed

.github/workflows/run-tests-l5.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: "Run Tests - Laravel 5"
22

33
on:
44
push:
5-
branches: [ v2.12, master ]
5+
branches: [ v2.12 ]
66

77
pull_request:
8-
branches: [ v2.12, master ]
8+
branches: [ v2.12 ]
99

1010
jobs:
1111
tests:

.github/workflows/run-tests-l7.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"name": "1ff/laravel-mongodb-cache",
33
"description": "A mongodb cache driver for laravel",
44
"type": "library",
5-
"version": "3.0.0",
5+
"version": "2.12.5",
66
"require": {
7-
"jenssegers/mongodb": "~3.7",
8-
"illuminate/cache": "^7.0"
7+
"jenssegers/mongodb": "^3.5|^3.6",
8+
"illuminate/cache": "^5.8|^6"
99
},
1010
"require-dev": {
11-
"orchestra/testbench": "^5.0"
11+
"orchestra/testbench": "^3.0|^4.0"
1212
},
1313
"license": "MIT",
1414
"authors": [

src/Store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getExpiration($key)
7777

7878
$expirationSeconds = $cacheData['expiration']->toDateTime()->getTimestamp();
7979

80-
return round(($expirationSeconds - time()) / 60);
80+
return round(($expirationSeconds - $this->currentTime()));
8181
}
8282

8383
/**

tests/StoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ public function it_retrieves_an_items_expiration_time_by_given_key()
140140
$sut = $this->store->getExpiration('test-key');
141141

142142
// Assert
143-
$this->assertEquals(2880.0, $sut); // 2 days in seconds.
143+
$this->assertEquals(172800, $sut); // 2 days in seconds.
144144
}
145145
}

0 commit comments

Comments
 (0)