1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-30 04:23:11 +03:00

Extracted many page-specific repo methods into page-specific repo

This commit is contained in:
Dan Brown
2018-10-13 11:27:55 +01:00
parent 495d18814a
commit 85f330c79a
21 changed files with 642 additions and 606 deletions

View File

@ -1,8 +1,9 @@
<?php namespace Tests;
use BookStack\Entities\Repos\PageRepo;
use BookStack\Uploads\Image;
use BookStack\Entities\Page;
use BookStack\Entities\EntityRepo;
use BookStack\Entities\Repos\EntityRepo;
use BookStack\Uploads\ImageService;
class ImageTest extends TestCase
@ -250,8 +251,8 @@ class ImageTest extends TestCase
$upload->assertStatus(200);
$image = Image::where('type', '=', 'gallery')->first();
$entityRepo = app(EntityRepo::class);
$entityRepo->updatePage($page, $page->book_id, [
$pageRepo = app(PageRepo::class);
$pageRepo->updatePage($page, $page->book_id, [
'name' => $page->name,
'html' => $page->html . "<img src=\"{$image->url}\">",
'summary' => ''
@ -263,7 +264,7 @@ class ImageTest extends TestCase
$this->assertCount(0, $toDelete);
// Save a revision of our page without the image;
$entityRepo->updatePage($page, $page->book_id, [
$pageRepo->updatePage($page, $page->book_id, [
'name' => $page->name,
'html' => "<p>Hello</p>",
'summary' => ''