Skip to content

[TASK] Migrate to rawr/phpunit-data-provider #1227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ updates:
- dependency-name: "phpstan/*"
- dependency-name: "phpunit/phpunit"
versions: [ ">= 9.0.0" ]
- dependency-name: "rawr/cross-data-providers"
- dependency-name: "rector/rector"
versioning-strategy: "increase"
commit-message:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"phpstan/phpstan-phpunit": "1.4.2 || 2.0.4",
"phpstan/phpstan-strict-rules": "1.6.2 || 2.0.3",
"phpunit/phpunit": "8.5.41",
"rawr/cross-data-providers": "2.4.0",
"rawr/phpunit-data-provider": "3.3.1",
"rector/rector": "1.2.10 || 2.0.7",
"rector/type-perfect": "1.0.0 || 2.0.2"
},
Expand Down
14 changes: 7 additions & 7 deletions tests/Unit/Comment/CommentContainerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Comment\Comment;
use Sabberworm\CSS\Tests\Unit\Comment\Fixtures\ConcreteCommentContainer;
use TRegx\DataProvider\DataProviders;
use TRegx\PhpUnit\DataProviders\DataProvider;

/**
* @covers \Sabberworm\CSS\Comment\CommentContainer
Expand Down Expand Up @@ -114,19 +114,19 @@ public function provideAlternativeNonemptyCommentArray(): array
* This provider crosses two comment arrays (0, 1 or 2 comments) with different comments,
* so that all combinations can be tested.
*
* @return array<non-empty-string, array{0: list<Comment>, 1: list<Comment>}>
* @return DataProvider<non-empty-string, array{0: list<Comment>, 1: list<Comment>}>
*/
public function provideTwoDistinctCommentArrays(): array
public function provideTwoDistinctCommentArrays(): DataProvider
{
return DataProviders::cross($this->provideCommentArray(), $this->provideAlternativeCommentArray());
return DataProvider::cross($this->provideCommentArray(), $this->provideAlternativeCommentArray());
}

/**
* @return array<non-empty-string, array{0: list<Comment>, 1: non-empty-list<Comment>}>
* @return DataProvider<non-empty-string, array{0: list<Comment>, 1: non-empty-list<Comment>}>
*/
public function provideTwoDistinctCommentArraysWithSecondNonempty(): array
public function provideTwoDistinctCommentArraysWithSecondNonempty(): DataProvider
{
return DataProviders::cross($this->provideCommentArray(), $this->provideAlternativeNonemptyCommentArray());
return DataProvider::cross($this->provideCommentArray(), $this->provideAlternativeNonemptyCommentArray());
}

private static function createContainsConstraint(Comment $comment): TraversableContains
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/Position/PositionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use PHPUnit\Framework\TestCase;
use Sabberworm\CSS\Tests\Unit\Position\Fixtures\ConcretePosition;
use TRegx\DataProvider\DataProviders;
use TRegx\PhpUnit\DataProviders\DataProvider;

/**
* @covers \Sabberworm\CSS\Position\Position
Expand Down Expand Up @@ -157,11 +157,11 @@ public function setPositionWithNullForColumnNumberClearsColumnNumber(): void
}

/**
* @return array<non-empty-string, array{0: int<1, max>, 1: int<0, max>}>
* @return DataProvider<non-empty-string, array{0: int<1, max>, 1: int<0, max>}>
*/
public function provideLineAndColumnNumber(): array
public function provideLineAndColumnNumber(): DataProvider
{
return DataProviders::cross($this->provideLineNumber(), $this->provideColumnNumber());
return DataProvider::cross($this->provideLineNumber(), $this->provideColumnNumber());
}

/**
Expand Down