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')); + } }