Skip to content

Commit 36ed5cd

Browse files
authored
[TASK] Migrate to rawr/phpunit-data-provider (#1227)
The package `rawr/cross-data-providers` that we used has been abandoned and should not be used anymore.
1 parent a675d12 commit 36ed5cd

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ updates:
2020
- dependency-name: "phpstan/*"
2121
- dependency-name: "phpunit/phpunit"
2222
versions: [ ">= 9.0.0" ]
23-
- dependency-name: "rawr/cross-data-providers"
2423
- dependency-name: "rector/rector"
2524
versioning-strategy: "increase"
2625
commit-message:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"phpstan/phpstan-phpunit": "1.4.2 || 2.0.4",
3434
"phpstan/phpstan-strict-rules": "1.6.2 || 2.0.3",
3535
"phpunit/phpunit": "8.5.41",
36-
"rawr/cross-data-providers": "2.4.0",
36+
"rawr/phpunit-data-provider": "3.3.1",
3737
"rector/rector": "1.2.10 || 2.0.7",
3838
"rector/type-perfect": "1.0.0 || 2.0.2"
3939
},

tests/Unit/Comment/CommentContainerTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use PHPUnit\Framework\TestCase;
1010
use Sabberworm\CSS\Comment\Comment;
1111
use Sabberworm\CSS\Tests\Unit\Comment\Fixtures\ConcreteCommentContainer;
12-
use TRegx\DataProvider\DataProviders;
12+
use TRegx\PhpUnit\DataProviders\DataProvider;
1313

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

124124
/**
125-
* @return array<non-empty-string, array{0: list<Comment>, 1: non-empty-list<Comment>}>
125+
* @return DataProvider<non-empty-string, array{0: list<Comment>, 1: non-empty-list<Comment>}>
126126
*/
127-
public function provideTwoDistinctCommentArraysWithSecondNonempty(): array
127+
public function provideTwoDistinctCommentArraysWithSecondNonempty(): DataProvider
128128
{
129-
return DataProviders::cross($this->provideCommentArray(), $this->provideAlternativeNonemptyCommentArray());
129+
return DataProvider::cross($this->provideCommentArray(), $this->provideAlternativeNonemptyCommentArray());
130130
}
131131

132132
private static function createContainsConstraint(Comment $comment): TraversableContains

tests/Unit/Position/PositionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use PHPUnit\Framework\TestCase;
88
use Sabberworm\CSS\Tests\Unit\Position\Fixtures\ConcretePosition;
9-
use TRegx\DataProvider\DataProviders;
9+
use TRegx\PhpUnit\DataProviders\DataProvider;
1010

1111
/**
1212
* @covers \Sabberworm\CSS\Position\Position
@@ -157,11 +157,11 @@ public function setPositionWithNullForColumnNumberClearsColumnNumber(): void
157157
}
158158

159159
/**
160-
* @return array<non-empty-string, array{0: int<1, max>, 1: int<0, max>}>
160+
* @return DataProvider<non-empty-string, array{0: int<1, max>, 1: int<0, max>}>
161161
*/
162-
public function provideLineAndColumnNumber(): array
162+
public function provideLineAndColumnNumber(): DataProvider
163163
{
164-
return DataProviders::cross($this->provideLineNumber(), $this->provideColumnNumber());
164+
return DataProvider::cross($this->provideLineNumber(), $this->provideColumnNumber());
165165
}
166166

167167
/**

0 commit comments

Comments
 (0)