99use PHPUnit \Framework \TestCase ;
1010use Sabberworm \CSS \Comment \Comment ;
1111use 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
@@ -42,10 +42,12 @@ public function provideCommentArray(): array
4242 return [
4343 'no comment ' => [[]],
4444 'one comment ' => [[new Comment ('Is this really a spoon? ' )]],
45- 'two comments ' => [[
46- new Comment ('I’m a teapot. ' ),
47- new Comment ('I’m a cafetière. ' ),
48- ]],
45+ 'two comments ' => [
46+ [
47+ new Comment ('I’m a teapot. ' ),
48+ new Comment ('I’m a cafetière. ' ),
49+ ],
50+ ],
4951 ];
5052 }
5153
@@ -87,10 +89,12 @@ public function provideAlternativeCommentArray(): array
8789 return [
8890 'no comment ' => [[]],
8991 'one comment ' => [[new Comment ('Can I eat it with my hands? ' )]],
90- 'two comments ' => [[
91- new Comment ('I’m a beer barrel. ' ),
92- new Comment ('I’m a vineyard. ' ),
93- ]],
92+ 'two comments ' => [
93+ [
94+ new Comment ('I’m a beer barrel. ' ),
95+ new Comment ('I’m a vineyard. ' ),
96+ ],
97+ ],
9498 ];
9599 }
96100
@@ -110,22 +114,22 @@ public function provideAlternativeNonemptyCommentArray(): array
110114 * This provider crosses two comment arrays (0, 1 or 2 comments) with different comments,
111115 * so that all combinations can be tested.
112116 *
113- * @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>}>
114118 */
115- public function provideTwoDistinctCommentArrays (): array
119+ public function provideTwoDistinctCommentArrays (): DataProvider
116120 {
117- return DataProviders ::cross ($ this ->provideCommentArray (), $ this ->provideAlternativeCommentArray ());
121+ return DataProvider ::cross ($ this ->provideCommentArray (), $ this ->provideAlternativeCommentArray ());
118122 }
119123
120124 /**
121- * @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>}>
122126 */
123- public function provideTwoDistinctCommentArraysWithSecondNonempty (): array
127+ public function provideTwoDistinctCommentArraysWithSecondNonempty (): DataProvider
124128 {
125- return DataProviders ::cross ($ this ->provideCommentArray (), $ this ->provideAlternativeNonemptyCommentArray ());
129+ return DataProvider ::cross ($ this ->provideCommentArray (), $ this ->provideAlternativeNonemptyCommentArray ());
126130 }
127131
128- private static function createContainsContstraint (Comment $ comment ): TraversableContains
132+ private static function createContainsConstraint (Comment $ comment ): TraversableContains
129133 {
130134 return new TraversableContains ($ comment );
131135 }
@@ -135,9 +139,9 @@ private static function createContainsContstraint(Comment $comment): Traversable
135139 *
136140 * @return non-empty-list<TraversableContains>
137141 */
138- private static function createContainsContstraints (array $ comments ): array
142+ private static function createContainsConstraints (array $ comments ): array
139143 {
140- return \array_map ([self ::class, 'createContainsContstraint ' ], $ comments );
144+ return \array_map ([self ::class, 'createContainsConstraint ' ], $ comments );
141145 }
142146
143147 /**
@@ -156,7 +160,7 @@ public function addCommentsKeepsOriginalComments(array $commentsToAdd, array $or
156160
157161 self ::assertThat (
158162 $ this ->subject ->getComments (),
159- LogicalAnd::fromConstraints (...self ::createContainsContstraints ($ originalComments ))
163+ LogicalAnd::fromConstraints (...self ::createContainsConstraints ($ originalComments ))
160164 );
161165 }
162166
@@ -176,7 +180,7 @@ public function addCommentsAfterCommentsSetAddsCommentsProvided(array $originalC
176180
177181 self ::assertThat (
178182 $ this ->subject ->getComments (),
179- LogicalAnd::fromConstraints (...self ::createContainsContstraints ($ commentsToAdd ))
183+ LogicalAnd::fromConstraints (...self ::createContainsConstraints ($ commentsToAdd ))
180184 );
181185 }
182186
0 commit comments