Skip to content

Commit f47abff

Browse files
authored
v5.x: Fixed expiration to be in seconds. (#32)
1 parent ba3dc19 commit f47abff

File tree

8 files changed

+5
-161
lines changed

8 files changed

+5
-161
lines changed

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

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

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

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

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

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

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

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

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

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

33
on:
44
push:
5-
branches: [ v5.x, master ]
5+
branches: [ v5.x ]
66

77
pull_request:
8-
branches: [ v5.x, master ]
8+
branches: [ v5.x ]
99

1010
jobs:
1111
tests:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "1ff/laravel-mongodb-cache",
33
"description": "A mongodb cache driver for laravel",
44
"type": "library",
5-
"version": "5.0.0",
5+
"version": "5.0.1",
66
"require": {
77
"jenssegers/mongodb": "~3.9",
88
"illuminate/cache": "^9.0"

src/Store.php

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

181181
$expirationSeconds = $cacheData['expiration']->toDateTime()->getTimestamp();
182182

183-
return round(($expirationSeconds - $this->currentTime()) / 60);
183+
return round($expirationSeconds - $this->currentTime());
184184
}
185185

186186
/**

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)