mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Laravel 8 shift squash & merge (#3029)
* Temporarily moved back config path * Apply Laravel coding style * Shift exception handler * Shift HTTP kernel and middleware * Shift service providers * Convert options array to fluent methods * Shift to class based routes * Shift console routes * Ignore temporary framework files * Shift to class based factories * Namespace seeders * Shift PSR-4 autoloading * Shift config files * Default config files * Shift Laravel dependencies * Shift return type of base TestCase methods * Shift cleanup * Applied stylci style changes * Reverted config files location * Applied manual changes to Laravel 8 shift Co-authored-by: Shift <shift@laravelshift.com>
This commit is contained in:
@ -19,7 +19,7 @@ class RolesTest extends TestCase
|
||||
{
|
||||
protected $user;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->user = $this->getViewer();
|
||||
@ -769,7 +769,7 @@ class RolesTest extends TestCase
|
||||
$this->giveUserPermissions($this->user, ['image-update-all']);
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->first();
|
||||
$image = factory(Image::class)->create([
|
||||
$image = Image::factory()->create([
|
||||
'uploaded_to' => $page->id,
|
||||
'created_by' => $this->user->id,
|
||||
'updated_by' => $this->user->id,
|
||||
@ -789,7 +789,7 @@ class RolesTest extends TestCase
|
||||
$admin = $this->getAdmin();
|
||||
/** @var Page $page */
|
||||
$page = Page::query()->first();
|
||||
$image = factory(Image::class)->create(['uploaded_to' => $page->id, 'created_by' => $admin->id, 'updated_by' => $admin->id]);
|
||||
$image = Image::factory()->create(['uploaded_to' => $page->id, 'created_by' => $admin->id, 'updated_by' => $admin->id]);
|
||||
|
||||
$this->actingAs($this->user)->json('delete', '/images/' . $image->id)->assertStatus(403);
|
||||
|
||||
@ -825,14 +825,14 @@ class RolesTest extends TestCase
|
||||
{
|
||||
$admin = $this->getAdmin();
|
||||
// Book links
|
||||
$book = factory(Book::class)->create(['created_by' => $admin->id, 'updated_by' => $admin->id]);
|
||||
$book = Book::factory()->create(['created_by' => $admin->id, 'updated_by' => $admin->id]);
|
||||
$this->regenEntityPermissions($book);
|
||||
$this->actingAs($this->getViewer())->get($book->getUrl())
|
||||
->assertDontSee('Create a new page')
|
||||
->assertDontSee('Add a chapter');
|
||||
|
||||
// Chapter links
|
||||
$chapter = factory(Chapter::class)->create(['created_by' => $admin->id, 'updated_by' => $admin->id, 'book_id' => $book->id]);
|
||||
$chapter = Chapter::factory()->create(['created_by' => $admin->id, 'updated_by' => $admin->id, 'book_id' => $book->id]);
|
||||
$this->regenEntityPermissions($chapter);
|
||||
$this->actingAs($this->getViewer())->get($chapter->getUrl())
|
||||
->assertDontSee('Create a new page')
|
||||
@ -926,14 +926,14 @@ class RolesTest extends TestCase
|
||||
|
||||
private function addComment(Page $page): TestResponse
|
||||
{
|
||||
$comment = factory(Comment::class)->make();
|
||||
$comment = Comment::factory()->make();
|
||||
|
||||
return $this->postJson("/comment/$page->id", $comment->only('text', 'html'));
|
||||
}
|
||||
|
||||
private function updateComment(Comment $comment): TestResponse
|
||||
{
|
||||
$commentData = factory(Comment::class)->make();
|
||||
$commentData = Comment::factory()->make();
|
||||
|
||||
return $this->putJson("/comment/{$comment->id}", $commentData->only('text', 'html'));
|
||||
}
|
||||
|
Reference in New Issue
Block a user