123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace Illuminate\Tests\Integration\Cache;
- use Illuminate\Foundation\Testing\Concerns\InteractsWithRedis;
- use Illuminate\Support\Facades\Cache;
- use Orchestra\Testbench\TestCase;
- class RedisStoreTest extends TestCase
- {
- use InteractsWithRedis;
- protected function setUp(): void
- {
- parent::setUp();
- $this->setUpRedis();
- }
- protected function tearDown(): void
- {
- parent::tearDown();
- $this->tearDownRedis();
- }
- public function testItCanStoreInfinite()
- {
- Cache::store('redis')->clear();
- $result = Cache::store('redis')->put('foo', INF);
- $this->assertTrue($result);
- $this->assertSame(INF, Cache::store('redis')->get('foo'));
- $result = Cache::store('redis')->put('bar', -INF);
- $this->assertTrue($result);
- $this->assertSame(-INF, Cache::store('redis')->get('bar'));
- }
- public function testItCanStoreNan()
- {
- Cache::store('redis')->clear();
- $result = Cache::store('redis')->put('foo', NAN);
- $this->assertTrue($result);
- $this->assertNan(Cache::store('redis')->get('foo'));
- }
- }
|