diff --git a/composer.json b/composer.json
index b9ef287a..4c36229a 100644
--- a/composer.json
+++ b/composer.json
@@ -41,7 +41,7 @@
"doctrine/coding-standard": "^12",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-phpunit": "^1.0",
- "phpunit/phpunit": "^9.5",
+ "phpunit/phpunit": "^10.5",
"vimeo/psalm": "^5.11"
},
"autoload": {
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 8dacf950..e75d8aeb 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -1,9 +1,7 @@
-
@@ -13,9 +11,9 @@
-
+
+
diff --git a/src/ReadableCollection.php b/src/ReadableCollection.php
index 53d0bf37..a8dbd43f 100644
--- a/src/ReadableCollection.php
+++ b/src/ReadableCollection.php
@@ -229,11 +229,11 @@ public function findFirst(Closure $p);
* Applies iteratively the given function to each element in the collection,
* so as to reduce the collection to a single value.
*
- * @psalm-param Closure(TReturn|TInitial|null, T):(TInitial|TReturn) $func
- * @psalm-param TInitial|null $initial
+ * @psalm-param Closure(TReturn|TInitial, T):TReturn $func
+ * @psalm-param TInitial $initial
*
* @return mixed
- * @psalm-return TReturn|TInitial|null
+ * @psalm-return TReturn|TInitial
*
* @psalm-template TReturn
* @psalm-template TInitial
diff --git a/tests/AbstractLazyArrayCollectionTest.php b/tests/AbstractLazyArrayCollectionTest.php
index 28e62cef..d0c0d1c0 100644
--- a/tests/AbstractLazyArrayCollectionTest.php
+++ b/tests/AbstractLazyArrayCollectionTest.php
@@ -14,7 +14,7 @@
*
* @covers \Doctrine\Common\Collections\AbstractLazyCollection
*/
-class AbstractLazyArrayCollectionTest extends BaseArrayCollectionTest
+class AbstractLazyArrayCollectionTest extends ArrayCollectionTestCase
{
/**
* @param mixed[] $elements
diff --git a/tests/AbstractLazyCollectionTest.php b/tests/AbstractLazyCollectionTest.php
index e30b6969..8f38e238 100644
--- a/tests/AbstractLazyCollectionTest.php
+++ b/tests/AbstractLazyCollectionTest.php
@@ -16,7 +16,7 @@
*
* @covers \Doctrine\Common\Collections\AbstractLazyCollection
*/
-class AbstractLazyCollectionTest extends BaseCollectionTest
+class AbstractLazyCollectionTest extends CollectionTestCase
{
protected function setUp(): void
{
diff --git a/tests/ArrayCollectionTest.php b/tests/ArrayCollectionTest.php
index bde74f88..f2f7cb88 100644
--- a/tests/ArrayCollectionTest.php
+++ b/tests/ArrayCollectionTest.php
@@ -20,7 +20,7 @@
*
* @covers \Doctrine\Common\Collections\ArrayCollection
*/
-class ArrayCollectionTest extends BaseArrayCollectionTest
+class ArrayCollectionTest extends ArrayCollectionTestCase
{
/**
* @param mixed[] $elements
diff --git a/tests/BaseArrayCollectionTest.php b/tests/ArrayCollectionTestCase.php
similarity index 98%
rename from tests/BaseArrayCollectionTest.php
rename to tests/ArrayCollectionTestCase.php
index a762d947..260fe724 100644
--- a/tests/BaseArrayCollectionTest.php
+++ b/tests/ArrayCollectionTestCase.php
@@ -21,7 +21,7 @@
use function next;
use function reset;
-abstract class BaseArrayCollectionTest extends TestCase
+abstract class ArrayCollectionTestCase extends TestCase
{
/**
* @param mixed[] $elements
@@ -184,7 +184,7 @@ public function testIterator(array $elements): void
}
/** @psalm-return array */
- public function provideDifferentElements(): array
+ public static function provideDifferentElements(): array
{
return [
'indexed' => [[1, 2, 3, 4, 5]],
@@ -369,7 +369,7 @@ public function testMatchingWithSlicingPreserveKeys(array $array, array $slicedA
}
/** @return mixed[][] */
- public function provideSlices(): array
+ public static function provideSlices(): array
{
return [
'preserve numeric keys' => [
diff --git a/tests/CollectionTest.php b/tests/CollectionTest.php
index 2717d225..1daa5566 100644
--- a/tests/CollectionTest.php
+++ b/tests/CollectionTest.php
@@ -16,7 +16,7 @@
use function count;
use function is_string;
-class CollectionTest extends BaseCollectionTest
+class CollectionTest extends CollectionTestCase
{
protected function setUp(): void
{
diff --git a/tests/BaseCollectionTest.php b/tests/CollectionTestCase.php
similarity index 99%
rename from tests/BaseCollectionTest.php
rename to tests/CollectionTestCase.php
index 61616359..4dc136b0 100644
--- a/tests/BaseCollectionTest.php
+++ b/tests/CollectionTestCase.php
@@ -16,7 +16,7 @@
use function is_string;
use function sprintf;
-abstract class BaseCollectionTest extends TestCase
+abstract class CollectionTestCase extends TestCase
{
/** @var Collection */
protected Collection $collection;
diff --git a/tests/Expr/CompositeExpressionTest.php b/tests/Expr/CompositeExpressionTest.php
index a5a3d6f9..31b85562 100644
--- a/tests/Expr/CompositeExpressionTest.php
+++ b/tests/Expr/CompositeExpressionTest.php
@@ -15,12 +15,18 @@
class CompositeExpressionTest extends TestCase
{
/** @return list}> */
- public function invalidDataProvider(): array
+ public static function invalidDataProvider(): array
{
return [
['type' => CompositeExpression::TYPE_AND, 'expressions' => [new Value('value')]],
['type' => CompositeExpression::TYPE_AND, 'expressions' => ['wrong-type']],
- ['type' => CompositeExpression::TYPE_NOT, 'expressions' => [$this->createMock(Expression::class), $this->createMock(Expression::class)]],
+ [
+ 'type' => CompositeExpression::TYPE_NOT,
+ 'expressions' => [
+ self::createStub(Expression::class),
+ self::createStub(Expression::class),
+ ],
+ ],
];
}