diff --git a/.github/workflows/run-tests-l5.yml b/.github/workflows/run-tests-l5.yml deleted file mode 100644 index b275b1f..0000000 --- a/.github/workflows/run-tests-l5.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: "Run Tests - Laravel 5" - -on: - push: - branches: [ v2.12, master ] - - pull_request: - branches: [ v2.12, master ] - -jobs: - tests: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: [7.2, 7.3, 7.4] - laravel: [5.*] - include: - - laravel: 5.* - testbench: 3 - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: pdo, sqlite, pdo_sqlite - - - name: Install Dependencies - run: composer install - - - name: Execute tests - run: vendor/bin/phpunit diff --git a/.github/workflows/run-tests-l6.yml b/.github/workflows/run-tests-l6.yml deleted file mode 100644 index e6468cb..0000000 --- a/.github/workflows/run-tests-l6.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: "Run Tests - Laravel 6" - -on: - push: - branches: [ v2.12 ] - - pull_request: - branches: [ v2.12 ] - -jobs: - tests: - - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - php: [7.2, 7.3, 7.4] - laravel: [6.*] - include: - - laravel: 6.* - testbench: 4 - - name: P${{ matrix.php }} - L${{ matrix.laravel }} - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - extensions: pdo, sqlite, pdo_sqlite - - - name: Install Dependencies - run: composer install - - - name: Execute tests - run: vendor/bin/phpunit diff --git a/composer.json b/composer.json index d9be683..ae9f805 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "1ff/laravel-mongodb-cache", "description": "A mongodb cache driver for laravel", "type": "library", - "version": "3.1.0", + "version": "3.1.1", "require": { "jenssegers/mongodb": "~3.7", "illuminate/cache": "^7.0" diff --git a/src/Store.php b/src/Store.php index 6d1e058..5d758f3 100644 --- a/src/Store.php +++ b/src/Store.php @@ -180,7 +180,7 @@ public function getExpiration($key) $expirationSeconds = $cacheData['expiration']->toDateTime()->getTimestamp(); - return round(($expirationSeconds - $this->currentTime()) / 60); + return round($expirationSeconds - $this->currentTime()); } /** diff --git a/tests/StoreTest.php b/tests/StoreTest.php index dd40071..502f9d2 100644 --- a/tests/StoreTest.php +++ b/tests/StoreTest.php @@ -140,6 +140,6 @@ public function it_retrieves_an_items_expiration_time_by_given_key() $sut = $this->store->getExpiration('test-key'); // Assert - $this->assertEquals(2880.0, $sut); // 2 days in seconds. + $this->assertEquals(172800, $sut); // 2 days in seconds. } }