From c3fea58e2b6f67fb475b303050ab679828c7beb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Tue, 30 Jul 2019 21:03:40 +0200 Subject: [PATCH] Add cache persistence test --- tests/CacheManagerTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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')); + } }