Skip to content

Commit ee994fa

Browse files
committed
Testing: Addressed deprecation in test helper
Also updated version in phpunit config
1 parent 13a79b3 commit ee994fa

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

phpunit.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.5/phpunit.xsd"
44
bootstrap="vendor/autoload.php"
55
displayDetailsOnTestsThatTriggerDeprecations="true"
66
colors="true">

tests/Helpers/EntityProvider.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use BookStack\Entities\Models\Bookshelf;
77
use BookStack\Entities\Models\Chapter;
88
use BookStack\Entities\Models\Entity;
9-
use BookStack\Entities\Models\HasCoverImage;
109
use BookStack\Entities\Models\Page;
1110
use BookStack\Entities\Repos\BookRepo;
1211
use BookStack\Entities\Repos\BookshelfRepo;
@@ -34,9 +33,9 @@ class EntityProvider
3433
];
3534

3635
/**
37-
* Get an un-fetched page from the system.
36+
* Get an unfetched page from the system.
3837
*/
39-
public function page(callable $queryFilter = null): Page
38+
public function page(callable|null $queryFilter = null): Page
4039
{
4140
/** @var Page $page */
4241
$page = Page::query()->when($queryFilter, $queryFilter)->whereNotIn('id', $this->fetchCache['page'])->first();
@@ -64,9 +63,9 @@ public function templatePage(): Page
6463
}
6564

6665
/**
67-
* Get an un-fetched chapter from the system.
66+
* Get an unfetched chapter from the system.
6867
*/
69-
public function chapter(callable $queryFilter = null): Chapter
68+
public function chapter(callable|null $queryFilter = null): Chapter
7069
{
7170
/** @var Chapter $chapter */
7271
$chapter = Chapter::query()->when($queryFilter, $queryFilter)->whereNotIn('id', $this->fetchCache['chapter'])->first();
@@ -80,9 +79,9 @@ public function chapterHasPages(): Chapter
8079
}
8180

8281
/**
83-
* Get an un-fetched book from the system.
82+
* Get an unfetched book from the system.
8483
*/
85-
public function book(callable $queryFilter = null): Book
84+
public function book(callable|null $queryFilter = null): Book
8685
{
8786
/** @var Book $book */
8887
$book = Book::query()->when($queryFilter, $queryFilter)->whereNotIn('id', $this->fetchCache['book'])->first();
@@ -101,9 +100,9 @@ public function bookHasChaptersAndPages(): Book
101100
}
102101

103102
/**
104-
* Get an un-fetched shelf from the system.
103+
* Get an unfetched shelf from the system.
105104
*/
106-
public function shelf(callable $queryFilter = null): Bookshelf
105+
public function shelf(callable|null $queryFilter = null): Bookshelf
107106
{
108107
/** @var Bookshelf $shelf */
109108
$shelf = Bookshelf::query()->when($queryFilter, $queryFilter)->whereNotIn('id', $this->fetchCache['bookshelf'])->first();

0 commit comments

Comments
 (0)