aboutsummaryrefslogtreecommitdiff
path: root/tests/app/Models/SearchTest.php
diff options
context:
space:
mode:
authorGravatar Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> 2023-05-30 23:03:14 +0200
committerGravatar GitHub <noreply@github.com> 2023-05-30 23:03:14 +0200
commit1d2bb50f2e0721102a3739ce5b13ff77a772fe15 (patch)
tree31716dc3b6d4b87c81a9d9dde3b86321aba38bdf /tests/app/Models/SearchTest.php
parentadb5db9d971fb425c2949191605071c1389c30f6 (diff)
phpstan-9 for Share.php (#5431)
* phpstan 9 for Search.php phpstan 9 for Share.php * phpstan-9 for Search.php * Better consistency for search results --------- Co-authored-by: Luc <sanchezluc+freshrss@gmail.com> Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'tests/app/Models/SearchTest.php')
-rw-r--r--tests/app/Models/SearchTest.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/app/Models/SearchTest.php b/tests/app/Models/SearchTest.php
index fa41542be..0b832737a 100644
--- a/tests/app/Models/SearchTest.php
+++ b/tests/app/Models/SearchTest.php
@@ -7,7 +7,7 @@ class SearchTest extends PHPUnit\Framework\TestCase {
/**
* @dataProvider provideEmptyInput
*/
- public function test__construct_whenInputIsEmpty_getsOnlyNullValues(?string $input): void {
+ public function test__construct_whenInputIsEmpty_getsOnlyNullValues(string $input): void {
$search = new FreshRSS_Search($input);
self::assertEquals('', $search->getRawInput());
self::assertNull($search->getIntitle());
@@ -23,13 +23,13 @@ class SearchTest extends PHPUnit\Framework\TestCase {
/**
* Return an array of values for the search object.
* Here is the description of the values
- * @return array{array{''},array{null}}
+ * @return array{array{''},array{' '}}
*/
public function provideEmptyInput(): array {
- return array(
- array(''),
- array(null),
- );
+ return [
+ [''],
+ [' '],
+ ];
}
/**
@@ -58,7 +58,7 @@ class SearchTest extends PHPUnit\Framework\TestCase {
array('word1 intitle:"word2 word3"', array('word2 word3'), array('word1')),
array("word1 intitle:'word2 word3'", array('word2 word3'), array('word1')),
array('intitle:word1 intitle:word2', array('word1', 'word2'), null),
- array('intitle: word1 word2', array(), array('word1', 'word2')),
+ array('intitle: word1 word2', null, array('word1', 'word2')),
array('intitle:123', array('123'), null),
array('intitle:"word1 word2" word3"', array('word1 word2'), array('word3"')),
array("intitle:'word1 word2' word3'", array('word1 word2'), array("word3'")),
@@ -95,7 +95,7 @@ class SearchTest extends PHPUnit\Framework\TestCase {
array('word1 author:"word2 word3"', array('word2 word3'), array('word1')),
array("word1 author:'word2 word3'", array('word2 word3'), array('word1')),
array('author:word1 author:word2', array('word1', 'word2'), null),
- array('author: word1 word2', array(), array('word1', 'word2')),
+ array('author: word1 word2', null, array('word1', 'word2')),
array('author:123', array('123'), null),
array('author:"word1 word2" word3"', array('word1 word2'), array('word3"')),
array("author:'word1 word2' word3'", array('word1 word2'), array("word3'")),
@@ -196,7 +196,7 @@ class SearchTest extends PHPUnit\Framework\TestCase {
public function provideTagsSearch(): array {
return array(
array('#word1', array('word1'), null),
- array('# word1', array(), array('#', 'word1')),
+ array('# word1', null, array('#', 'word1')),
array('#123', array('123'), null),
array('#word1 word2', array('word1'), array('word2')),
array('#"word1 word2"', array('"word1'), array('word2"')),