From: Dan Brown Date: Mon, 25 Aug 2025 14:01:13 +0000 (+0100) Subject: Testing: Addressed deprecation in test helper X-Git-Tag: v25.07.2~1^2~4 X-Git-Url: http://source.bookstackapp.com/bookstack/commitdiff_plain/ee994fa2b712ddf51befba2bba0ab106edc5e339 Testing: Addressed deprecation in test helper Also updated version in phpunit config --- diff --git a/phpunit.xml b/phpunit.xml index 243c3d3bc..a8e725d41 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,6 +1,6 @@ diff --git a/tests/Helpers/EntityProvider.php b/tests/Helpers/EntityProvider.php index 22e554f74..c794f9478 100644 --- a/tests/Helpers/EntityProvider.php +++ b/tests/Helpers/EntityProvider.php @@ -6,7 +6,6 @@ use BookStack\Entities\Models\Book; use BookStack\Entities\Models\Bookshelf; use BookStack\Entities\Models\Chapter; use BookStack\Entities\Models\Entity; -use BookStack\Entities\Models\HasCoverImage; use BookStack\Entities\Models\Page; use BookStack\Entities\Repos\BookRepo; use BookStack\Entities\Repos\BookshelfRepo; @@ -34,9 +33,9 @@ class EntityProvider ]; /** - * Get an un-fetched page from the system. + * Get an unfetched page from the system. */ - public function page(callable $queryFilter = null): Page + public function page(callable|null $queryFilter = null): Page { /** @var Page $page */ $page = Page::query()->when($queryFilter, $queryFilter)->whereNotIn('id', $this->fetchCache['page'])->first(); @@ -64,9 +63,9 @@ class EntityProvider } /** - * Get an un-fetched chapter from the system. + * Get an unfetched chapter from the system. */ - public function chapter(callable $queryFilter = null): Chapter + public function chapter(callable|null $queryFilter = null): Chapter { /** @var Chapter $chapter */ $chapter = Chapter::query()->when($queryFilter, $queryFilter)->whereNotIn('id', $this->fetchCache['chapter'])->first(); @@ -80,9 +79,9 @@ class EntityProvider } /** - * Get an un-fetched book from the system. + * Get an unfetched book from the system. */ - public function book(callable $queryFilter = null): Book + public function book(callable|null $queryFilter = null): Book { /** @var Book $book */ $book = Book::query()->when($queryFilter, $queryFilter)->whereNotIn('id', $this->fetchCache['book'])->first(); @@ -101,9 +100,9 @@ class EntityProvider } /** - * Get an un-fetched shelf from the system. + * Get an unfetched shelf from the system. */ - public function shelf(callable $queryFilter = null): Bookshelf + public function shelf(callable|null $queryFilter = null): Bookshelf { /** @var Bookshelf $shelf */ $shelf = Bookshelf::query()->when($queryFilter, $queryFilter)->whereNotIn('id', $this->fetchCache['bookshelf'])->first();