]>
BookStack Code Mirror - bookstack/blobdiff - tests/Commands/ClearViewsCommandTest.php
projects
/
bookstack
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added additional testing for editor switching permissions
[bookstack]
/
tests
/
Commands
/
ClearViewsCommandTest.php
diff --git
a/tests/Commands/ClearViewsCommandTest.php
b/tests/Commands/ClearViewsCommandTest.php
index 04665adcf2b384b200b2b728555b47e91a56168a..bbd06fa01086aeeb9fa3134669975ff9af83e2c7 100644
(file)
--- a/
tests/Commands/ClearViewsCommandTest.php
+++ b/
tests/Commands/ClearViewsCommandTest.php
@@
-1,4
+1,6
@@
-<?php namespace Tests\Commands;
+<?php
+
+namespace Tests\Commands;
use BookStack\Entities\Models\Page;
use Illuminate\Support\Facades\DB;
use BookStack\Entities\Models\Page;
use Illuminate\Support\Facades\DB;
@@
-6,7
+8,6
@@
use Tests\TestCase;
class ClearViewsCommandTest extends TestCase
{
class ClearViewsCommandTest extends TestCase
{
-
public function test_clear_views_command()
{
$this->asEditor();
public function test_clear_views_command()
{
$this->asEditor();
@@
-15,9
+16,9
@@
class ClearViewsCommandTest extends TestCase
$this->get($page->getUrl());
$this->assertDatabaseHas('views', [
$this->get($page->getUrl());
$this->assertDatabaseHas('views', [
- 'user_id' => $this->getEditor()->id,
+ 'user_id'
=> $this->getEditor()->id,
'viewable_id' => $page->id,
'viewable_id' => $page->id,
- 'views'
=> 1
+ 'views'
=> 1,
]);
DB::rollBack();
]);
DB::rollBack();
@@
-26,7
+27,7
@@
class ClearViewsCommandTest extends TestCase
$this->assertTrue($exitCode === 0, 'Command executed successfully');
$this->assertDatabaseMissing('views', [
$this->assertTrue($exitCode === 0, 'Command executed successfully');
$this->assertDatabaseMissing('views', [
- 'user_id' => $this->getEditor()->id
+ 'user_id' => $this->getEditor()->id
,
]);
}
]);
}
-}
\ No newline at end of file
+}