From f34e1e97ac1f6e6781e91b8aa047ad886d16aab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 30 Jul 2019 21:27:01 +0200 Subject: [PATCH] [1.6.0] [WIP] Fix cache persistence (#79) * Add cache persistence test * Change cache driver to redis --- phpunit.xml | 2 +- tests/CacheManagerTest.php | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/phpunit.xml b/phpunit.xml index 28aa16ad..26f7e0b2 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -24,7 +24,7 @@ - + diff --git a/tests/CacheManagerTest.php b/tests/CacheManagerTest.php index 5d087ada..938699d2 100644 --- a/tests/CacheManagerTest.php +++ b/tests/CacheManagerTest.php @@ -73,4 +73,19 @@ class CacheManagerTest extends TestCase cache(['foo' => 'xyz'], 1); $this->assertSame('xyz', cache('foo')); } + + /** @test */ + public function cache_is_persisted() + { + tenant()->create('foo.localhost'); + tenancy()->init('foo.localhost'); + + cache(['foo' => 'bar'], 10); + $this->assertSame('bar', cache('foo')); + + tenancy()->end(); + + tenancy()->init('foo.localhost'); + $this->assertSame('bar', cache('foo')); + } }