X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/6eda1c1fb28142d432bf0ca05d7eaba9bf16f0d0..refs/pull/3433/head:/tests/StatusTest.php diff --git a/tests/StatusTest.php b/tests/StatusTest.php index ca150d0d6..82c377615 100644 --- a/tests/StatusTest.php +++ b/tests/StatusTest.php @@ -1,20 +1,24 @@ get("/status"); + $resp = $this->get('/status'); $resp->assertStatus(200); $resp->assertJson([ 'database' => true, - 'cache' => true, - 'session' => true, + 'cache' => true, + 'session' => true, ]); } @@ -22,7 +26,7 @@ class StatusTest extends TestCase { DB::shouldReceive('table')->andThrow(new Exception()); - $resp = $this->get("/status"); + $resp = $this->get('/status'); $resp->assertStatus(500); $resp->assertJson([ 'database' => false, @@ -31,9 +35,11 @@ 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('pull')->andReturn('cat'); - $resp = $this->get("/status"); + $resp = $this->get('/status'); $resp->assertStatus(500); $resp->assertJson([ 'cache' => false, @@ -47,10 +53,10 @@ class StatusTest extends TestCase Session::swap($mockSession); $mockSession->shouldReceive('get')->andReturn('cat'); - $resp = $this->get("/status"); + $resp = $this->get('/status'); $resp->assertStatus(500); $resp->assertJson([ 'session' => false, ]); } -} \ No newline at end of file +}