Skip to content

Commit f76a032

Browse files
Added 7.1 compat
1 parent 56b0e3c commit f76a032

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ matrix:
88
- php: 5.6
99
env: COMPOSER_FLAGS="--prefer-lowest"
1010
- php: 7.0
11+
- php: 7.1
1112
env: COLLECT_COVERAGE="--coverage-clover build/coverage.clover"
1213
- php: hhvm
1314
dist: trusty

tests/unit/Laravel/CacheItemTest.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
namespace Madewithlove\IlluminatePsrCacheBridge\Tests\Unit\Laravel;
33

44
use Carbon\Carbon;
5+
use DateTimeImmutable;
56
use Madewithlove\IlluminatePsrCacheBridge\Laravel\CacheItem;
67
use PHPUnit_Framework_TestCase;
78
use Psr\Cache\CacheItemInterface;
@@ -45,8 +46,8 @@ public function it_remembers_its_key_and_value()
4546
// Act
4647

4748
// Assert
48-
$this->assertEquals('key', $item->getKey());
49-
$this->assertEquals($value, $item->get());
49+
$this->assertSame('key', $item->getKey());
50+
$this->assertSame($value, $item->get());
5051
}
5152

5253
/** @test */
@@ -58,7 +59,10 @@ public function it_can_set_ttl_in_seconds()
5859
// Act
5960

6061
// Assert
61-
$this->assertEquals(new \DateTimeImmutable('+ 1 minute'), $expiringInExactlyOneMinute->getExpiresAt());
62+
$this->assertSame(
63+
(new DateTimeImmutable('+ 1 minute'))->format('d-m-Y H:i:s'),
64+
$expiringInExactlyOneMinute->getExpiresAt()->format('d-m-Y H:i:s')
65+
);
6266
}
6367

6468
/** @test */
@@ -70,7 +74,10 @@ public function it_can_set_ttl_with_date_interval()
7074
// Act
7175

7276
// Assert
73-
$this->assertEquals(new \DateTimeImmutable('+ 1 minute'), $expiringInExactlyOneMinute->getExpiresAt());
77+
$this->assertSame(
78+
(new DateTimeImmutable('+ 1 minute'))->format('d-m-Y H:i:s'),
79+
$expiringInExactlyOneMinute->getExpiresAt()->format('d-m-Y H:i:s')
80+
);
7481
}
7582

7683
/** @test */
@@ -84,7 +91,7 @@ public function it_can_set_expiry_with_datetime()
8491
$item->expiresAt($now->addMinute());
8592

8693
// Assert
87-
$this->assertTrue($now == $item->getExpiresAt());
94+
$this->assertEquals($now, $item->getExpiresAt());
8895
}
8996

9097
/** @test */
@@ -109,7 +116,7 @@ public function it_will_remember_value_that_has_been_set()
109116
$item->set('bar');
110117

111118
// Assert
112-
$this->assertEquals('bar', $item->get());
119+
$this->assertSame('bar', $item->get());
113120
}
114121

115122
/** @test */

0 commit comments

Comments
 (0)