Skip to content

Commit

Permalink
Upgrade to PHPUnit 10
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Feb 19, 2024
1 parent a423a74 commit 258d386
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 2 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
>
Expand All @@ -13,9 +11,9 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./src/</directory>
</include>
</coverage>
</source>
</phpunit>
2 changes: 1 addition & 1 deletion tests/AbstractLazyArrayCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @covers \Doctrine\Common\Collections\AbstractLazyCollection
*/
class AbstractLazyArrayCollectionTest extends BaseArrayCollectionTest
class AbstractLazyArrayCollectionTest extends ArrayCollectionTestCase
{
/**
* @param mixed[] $elements
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractLazyCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @covers \Doctrine\Common\Collections\AbstractLazyCollection
*/
class AbstractLazyCollectionTest extends BaseCollectionTest
class AbstractLazyCollectionTest extends CollectionTestCase
{
protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ArrayCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @covers \Doctrine\Common\Collections\ArrayCollection
*/
class ArrayCollectionTest extends BaseArrayCollectionTest
class ArrayCollectionTest extends ArrayCollectionTestCase
{
/**
* @param mixed[] $elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
use function next;
use function reset;

abstract class BaseArrayCollectionTest extends TestCase
abstract class ArrayCollectionTestCase extends TestCase
{
/**
* @param mixed[] $elements
Expand Down Expand Up @@ -183,7 +183,7 @@ public function testIterator(array $elements): void
}

/** @psalm-return array<string, array{mixed[]}> */
public function provideDifferentElements(): array
public static function provideDifferentElements(): array
{
return [
'indexed' => [[1, 2, 3, 4, 5]],
Expand Down Expand Up @@ -359,7 +359,7 @@ public function testMatchingWithSlicingPreserveKeys(array $array, array $slicedA
}

/** @return mixed[][] */
public function provideSlices(): array
public static function provideSlices(): array
{
return [
'preserve numeric keys' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use function count;
use function is_string;

class CollectionTest extends BaseCollectionTest
class CollectionTest extends CollectionTestCase
{
protected function setUp(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use function is_string;
use function sprintf;

abstract class BaseCollectionTest extends TestCase
abstract class CollectionTestCase extends TestCase
{
/** @var Collection<mixed> */
protected Collection $collection;
Expand Down
10 changes: 8 additions & 2 deletions tests/Expr/CompositeExpressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@
class CompositeExpressionTest extends TestCase
{
/** @return list<array{type:string, expressions: list<mixed>}> */
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),
],
],
];
}

Expand Down

0 comments on commit 258d386

Please sign in to comment.