]> BookStack Code Mirror - bookstack/commitdiff
Made search test a little more consistent
authorDan Brown <redacted>
Sun, 23 Sep 2018 14:15:44 +0000 (15:15 +0100)
committerDan Brown <redacted>
Sun, 23 Sep 2018 14:15:44 +0000 (15:15 +0100)
tests/Entity/EntitySearchTest.php
tests/SharedTestHelpers.php

index 4b2fd56630c703ca40d8fb657cfd76c548a9627d..301f0d02d73ca221f2377523d9c93f6b1790114c 100644 (file)
@@ -172,7 +172,7 @@ class EntitySearchTest extends TestCase
 
     public function test_ajax_entity_search()
     {
-        $page = Page::all()->last();
+        $page = $this->newPage(['name' => 'my ajax search test', 'html' => 'ajax test']);
         $notVisitedPage = Page::first();
 
         // Visit the page to make popular
index 581dac5f1e954014f67c809e57dd4d0e7d42e87f..ad983423c6f1122fcf056a6a15cdc48c4bfd22c5 100644 (file)
@@ -4,6 +4,7 @@ use BookStack\Book;
 use BookStack\Bookshelf;
 use BookStack\Chapter;
 use BookStack\Entity;
+use BookStack\Page;
 use BookStack\Repos\EntityRepo;
 use BookStack\Repos\PermissionsRepo;
 use BookStack\Role;
@@ -112,7 +113,7 @@ trait SharedTestHelpers
     /**
      * Create and return a new test page
      * @param array $input
-     * @return Chapter
+     * @return Page
      */
     public function newPage($input = ['name' => 'test page', 'html' => 'My new test page']) {
         $book = Book::first();