Made search test a little more consistent

This commit is contained in:
Dan Brown 2018-09-23 15:15:44 +01:00
parent 93f820d9da
commit 9243c635f2
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
2 changed files with 3 additions and 2 deletions

View File

@ -172,7 +172,7 @@ class EntitySearchTest extends TestCase
public function test_ajax_entity_search() public function test_ajax_entity_search()
{ {
$page = Page::all()->last(); $page = $this->newPage(['name' => 'my ajax search test', 'html' => 'ajax test']);
$notVisitedPage = Page::first(); $notVisitedPage = Page::first();
// Visit the page to make popular // Visit the page to make popular

View File

@ -4,6 +4,7 @@ use BookStack\Book;
use BookStack\Bookshelf; use BookStack\Bookshelf;
use BookStack\Chapter; use BookStack\Chapter;
use BookStack\Entity; use BookStack\Entity;
use BookStack\Page;
use BookStack\Repos\EntityRepo; use BookStack\Repos\EntityRepo;
use BookStack\Repos\PermissionsRepo; use BookStack\Repos\PermissionsRepo;
use BookStack\Role; use BookStack\Role;
@ -112,7 +113,7 @@ trait SharedTestHelpers
/** /**
* Create and return a new test page * Create and return a new test page
* @param array $input * @param array $input
* @return Chapter * @return Page
*/ */
public function newPage($input = ['name' => 'test page', 'html' => 'My new test page']) { public function newPage($input = ['name' => 'test page', 'html' => 'My new test page']) {
$book = Book::first(); $book = Book::first();