]>
BookStack Code Mirror - bookstack/blobdiff - tests/StatusTest.php
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Images: Added nulling of image page relation on page delete
[bookstack]
/
tests
/
StatusTest.php
diff --git
a/tests/StatusTest.php
b/tests/StatusTest.php
index b4c35cf91759774060a48a715d7ea594d54419da..82c377615c9adf8a5eebb0578eae1a70f07921e9 100644
(file)
--- a/
tests/StatusTest.php
+++ b/
tests/StatusTest.php
@@
-1,21
+1,24
@@
<?php
<?php
+namespace Tests;
+
+use Exception;
use Illuminate\Cache\ArrayStore;
use Illuminate\Cache\ArrayStore;
-use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Cache;
+use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Session;
-use
Tests\TestCase
;
+use
Mockery
;
class StatusTest extends TestCase
{
public function test_returns_json_with_expected_results()
{
class StatusTest extends TestCase
{
public function test_returns_json_with_expected_results()
{
- $resp = $this->get(
"/status"
);
+ $resp = $this->get(
'/status'
);
$resp->assertStatus(200);
$resp->assertJson([
'database' => true,
$resp->assertStatus(200);
$resp->assertJson([
'database' => true,
- 'cache' => true,
- 'session' => true,
+ 'cache'
=> true,
+ 'session'
=> true,
]);
}
]);
}
@@
-23,7
+26,7
@@
class StatusTest extends TestCase
{
DB::shouldReceive('table')->andThrow(new Exception());
{
DB::shouldReceive('table')->andThrow(new Exception());
- $resp = $this->get(
"/status"
);
+ $resp = $this->get(
'/status'
);
$resp->assertStatus(500);
$resp->assertJson([
'database' => false,
$resp->assertStatus(500);
$resp->assertJson([
'database' => false,
@@
-34,9
+37,9
@@
class StatusTest extends TestCase
{
$mockStore = Mockery::mock(new ArrayStore())->makePartial();
Cache::swap($mockStore);
{
$mockStore = Mockery::mock(new ArrayStore())->makePartial();
Cache::swap($mockStore);
- $mockStore->shouldReceive('
get
')->andReturn('cat');
+ $mockStore->shouldReceive('
pull
')->andReturn('cat');
- $resp = $this->get(
"/status"
);
+ $resp = $this->get(
'/status'
);
$resp->assertStatus(500);
$resp->assertJson([
'cache' => false,
$resp->assertStatus(500);
$resp->assertJson([
'cache' => false,
@@
-50,10
+53,10
@@
class StatusTest extends TestCase
Session::swap($mockSession);
$mockSession->shouldReceive('get')->andReturn('cat');
Session::swap($mockSession);
$mockSession->shouldReceive('get')->andReturn('cat');
- $resp = $this->get(
"/status"
);
+ $resp = $this->get(
'/status'
);
$resp->assertStatus(500);
$resp->assertJson([
'session' => false,
]);
}
$resp->assertStatus(500);
$resp->assertJson([
'session' => false,
]);
}
-}
\ No newline at end of file
+}