From 96b8c403a8783b514abc280afd96cd3c06e900c2 Mon Sep 17 00:00:00 2001 From: Dan Brown Date: Sat, 30 Dec 2017 16:09:27 +0000 Subject: [PATCH] Fixed failing book view test Also ensured setting system localcache is cleared correctly --- app/Services/SettingService.php | 3 +++ tests/Entity/EntityTest.php | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Services/SettingService.php b/app/Services/SettingService.php index 18a7c0d1b..ce87f5a4b 100644 --- a/app/Services/SettingService.php +++ b/app/Services/SettingService.php @@ -98,6 +98,9 @@ class SettingService { $cacheKey = $this->cachePrefix . $key; $this->cache->forget($cacheKey); + if (isset($this->localCache[$key])) { + unset($this->localCache[$key]); + } } /** diff --git a/tests/Entity/EntityTest.php b/tests/Entity/EntityTest.php index 549253417..4d4e0e6cd 100644 --- a/tests/Entity/EntityTest.php +++ b/tests/Entity/EntityTest.php @@ -90,14 +90,14 @@ class EntityTest extends BrowserKitTest $this->actingAs($editor) ->visit('/books') ->pageHasElement('.featured-image-container') - ->submitForm('Toggle Book View') + ->submitForm('List View') // Check redirection. ->seePageIs('/books') ->pageNotHasElement('.featured-image-container'); $this->actingAs($editor) ->visit('/books') - ->submitForm('Toggle Book View') + ->submitForm('Grid View') ->seePageIs('/books') ->pageHasElement('.featured-image-container');