1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2024-10-30 07:32:39 +01:00

Changed how the cache is mocked in status test

This commit is contained in:
Dan Brown 2021-01-28 23:13:55 +00:00
parent 3df6c9ac05
commit 0dac9c68f0

View 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);