mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +03:00
Fixed some mis-refactoring and split search service
Search service broken into index and runner tools.
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
<?php namespace Tests;
|
||||
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Models\Book;
|
||||
|
||||
class ActivityTrackingTest extends BrowserKitTest
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Api;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ApiListingTest extends TestCase
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Api;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use Tests\TestCase;
|
||||
|
||||
class BooksApiTest extends TestCase
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php namespace Tests\Api;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ChaptersApiTest extends TestCase
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php namespace Tests\Api;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ShelvesApiTest extends TestCase
|
||||
|
@ -5,7 +5,7 @@ use BookStack\Actions\ActivityService;
|
||||
use BookStack\Actions\ActivityType;
|
||||
use BookStack\Auth\UserRepo;
|
||||
use BookStack\Entities\Tools\TrashCan;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use Carbon\Carbon;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use BookStack\Auth\Role;
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Notifications\ConfirmEmail;
|
||||
use BookStack\Notifications\ResetPassword;
|
||||
use BookStack\Settings\SettingService;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests;
|
||||
|
||||
use BookStack\Entities\Entity;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use BookStack\Auth\Role;
|
||||
use BookStack\Auth\Permissions\PermissionService;
|
||||
use BookStack\Settings\SettingService;
|
||||
@ -71,9 +71,9 @@ abstract class BrowserKitTest extends TestCase
|
||||
protected function createEntityChainBelongingToUser($creatorUser, $updaterUser = false)
|
||||
{
|
||||
if ($updaterUser === false) $updaterUser = $creatorUser;
|
||||
$book = factory(\BookStack\Entities\Book::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]);
|
||||
$chapter = factory(\BookStack\Entities\Chapter::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id, 'book_id' => $book->id]);
|
||||
$page = factory(\BookStack\Entities\Page::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id, 'book_id' => $book->id, 'chapter_id' => $chapter->id]);
|
||||
$book = factory(\BookStack\Entities\Models\Book::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id]);
|
||||
$chapter = factory(\BookStack\Entities\Models\Chapter::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id, 'book_id' => $book->id]);
|
||||
$page = factory(\BookStack\Entities\Models\Page::class)->create(['created_by' => $creatorUser->id, 'updated_by' => $updaterUser->id, 'book_id' => $book->id, 'chapter_id' => $chapter->id]);
|
||||
$restrictionService = $this->app[PermissionService::class];
|
||||
$restrictionService->buildJointPermissionsForEntity($book);
|
||||
return [
|
||||
|
@ -4,8 +4,8 @@ use BookStack\Actions\ActivityType;
|
||||
use BookStack\Actions\Comment;
|
||||
use BookStack\Actions\CommentRepo;
|
||||
use BookStack\Auth\Permissions\JointPermission;
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use Symfony\Component\Console\Exception\RuntimeException;
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Uploads\Image;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use Tests\TestCase;
|
||||
|
||||
class BookTest extends TestCase
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ChapterTest extends TestCase
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\BrowserKitTest;
|
||||
|
||||
class CommentSettingTest extends BrowserKitTest
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Actions\Comment;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Actions\Tag;
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\TestCase;
|
||||
|
||||
class EntitySearchTest extends TestCase
|
||||
|
@ -1,9 +1,9 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Auth\UserRepo;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use Carbon\Carbon;
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Uploads\HttpFetcher;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
@ -9,7 +9,7 @@ class MarkdownTest extends BrowserKitTest
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->page = \BookStack\Entities\Page::first();
|
||||
$this->page = \BookStack\Entities\Models\Page::first();
|
||||
}
|
||||
|
||||
protected function setMarkdownEditor()
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Tools\PageContent;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PageContentTest extends TestCase
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use Tests\BrowserKitTest;
|
||||
|
||||
@ -16,7 +16,7 @@ class PageDraftTest extends BrowserKitTest
|
||||
public function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
$this->page = \BookStack\Entities\Page::first();
|
||||
$this->page = \BookStack\Entities\Models\Page::first();
|
||||
$this->pageRepo = app(PageRepo::class);
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ class PageDraftTest extends BrowserKitTest
|
||||
|
||||
public function test_alert_message_shows_if_someone_else_editing()
|
||||
{
|
||||
$nonEditedPage = \BookStack\Entities\Page::take(10)->get()->last();
|
||||
$nonEditedPage = \BookStack\Entities\Models\Page::take(10)->get()->last();
|
||||
$addedContent = '<p>test message content</p>';
|
||||
$this->asAdmin()->visit($this->page->getUrl('/edit'))
|
||||
->dontSeeInField('html', $addedContent);
|
||||
@ -75,7 +75,7 @@ class PageDraftTest extends BrowserKitTest
|
||||
|
||||
public function test_draft_pages_show_on_homepage()
|
||||
{
|
||||
$book = \BookStack\Entities\Book::first();
|
||||
$book = \BookStack\Entities\Models\Book::first();
|
||||
$this->asAdmin()->visit('/')
|
||||
->dontSeeInElement('#recent-drafts', 'New Page')
|
||||
->visit($book->getUrl() . '/create-page')
|
||||
@ -85,7 +85,7 @@ class PageDraftTest extends BrowserKitTest
|
||||
|
||||
public function test_draft_pages_not_visible_by_others()
|
||||
{
|
||||
$book = \BookStack\Entities\Book::first();
|
||||
$book = \BookStack\Entities\Models\Book::first();
|
||||
$chapter = $book->chapters->first();
|
||||
$newUser = $this->getEditor();
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PageTemplateTest extends TestCase
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\TestCase;
|
||||
|
||||
class PageTest extends TestCase
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\SearchOptions;
|
||||
use BookStack\Entities\Tools\SearchOptions;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SearchOptionsTest extends TestCase
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
<?php namespace Tests\Entity;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Actions\Tag;
|
||||
use BookStack\Entities\Entity;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Auth\Permissions\PermissionService;
|
||||
use Tests\BrowserKitTest;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ErrorTest extends TestCase
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests;
|
||||
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
|
||||
class HomepageTest extends TestCase
|
||||
{
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php namespace Tests\Permissions;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Entity;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Tests\BrowserKitTest;
|
||||
|
||||
class RestrictionsTest extends BrowserKitTest
|
||||
|
@ -2,10 +2,10 @@
|
||||
|
||||
use BookStack\Actions\Comment;
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Auth\Role;
|
||||
use BookStack\Uploads\Image;
|
||||
use Laravel\BrowserKitTesting\HttpException;
|
||||
|
@ -5,9 +5,9 @@ use BookStack\Auth\Permissions\PermissionService;
|
||||
use BookStack\Auth\Permissions\RolePermission;
|
||||
use BookStack\Auth\Role;
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Page;
|
||||
|
||||
class PublicActionTest extends BrowserKitTest
|
||||
{
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?php namespace Tests;
|
||||
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Deletion;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Deletion;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use DB;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
<?php namespace Tests;
|
||||
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Book;
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Chapter;
|
||||
use BookStack\Entities\Entity;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Book;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use BookStack\Entities\Models\Chapter;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Entities\Repos\BookRepo;
|
||||
use BookStack\Entities\Repos\BookshelfRepo;
|
||||
use BookStack\Entities\Repos\ChapterRepo;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests;
|
||||
|
||||
use BookStack\Entities\Entity;
|
||||
use BookStack\Entities\Models\Entity;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
use BookStack\Entities\Tools\TrashCan;
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use BookStack\Uploads\Attachment;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Auth\Permissions\PermissionService;
|
||||
use BookStack\Uploads\AttachmentService;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Uploads;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Uploads\Image;
|
||||
use Tests\TestCase;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
use BookStack\Entities\Repos\PageRepo;
|
||||
use BookStack\Uploads\Image;
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use BookStack\Uploads\ImageService;
|
||||
use Illuminate\Support\Str;
|
||||
use Tests\TestCase;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php namespace Tests\Uploads;
|
||||
|
||||
use BookStack\Entities\Page;
|
||||
use BookStack\Entities\Models\Page;
|
||||
use Illuminate\Http\UploadedFile;
|
||||
|
||||
trait UsesImages
|
||||
|
@ -3,7 +3,7 @@
|
||||
use Activity;
|
||||
use BookStack\Actions\ActivityType;
|
||||
use BookStack\Auth\User;
|
||||
use BookStack\Entities\Bookshelf;
|
||||
use BookStack\Entities\Models\Bookshelf;
|
||||
use Tests\BrowserKitTest;
|
||||
|
||||
class UserProfileTest extends BrowserKitTest
|
||||
|
Reference in New Issue
Block a user