]> BookStack Code Mirror - bookstack/commitdiff
Changed how the cache is mocked in status test
authorDan Brown <redacted>
Thu, 28 Jan 2021 23:13:55 +0000 (23:13 +0000)
committerDan Brown <redacted>
Thu, 28 Jan 2021 23:13:55 +0000 (23:13 +0000)
tests/StatusTest.php

index ca150d0d65aaf6409ca5a63b158b13abc13837fe..b4c35cf91759774060a48a715d7ea594d54419da 100644 (file)
@@ -1,5 +1,6 @@
 <?php
 
+use Illuminate\Cache\ArrayStore;
 use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Cache;
 use Illuminate\Support\Facades\Session;
@@ -31,7 +32,9 @@ class StatusTest extends TestCase
 
     public function test_returns_500_status_and_false_on_wrong_cache_return()
     {
-        Cache::partialMock()->shouldReceive('get')->andReturn('cat');
+        $mockStore = Mockery::mock(new ArrayStore())->makePartial();
+        Cache::swap($mockStore);
+        $mockStore->shouldReceive('get')->andReturn('cat');
 
         $resp = $this->get("/status");
         $resp->assertStatus(500);
Morty Proxy This is a proxified and sanitized view of the page, visit original site.