Skip to content

Commit 65bb1e7

Browse files
committed
Rename test methods to focus on the main method under test
In most cases this is either `addComments` or `setComments`, rather than `getComments`.
1 parent 94a17b4 commit 65bb1e7

File tree

1 file changed

+9
-15
lines changed

1 file changed

+9
-15
lines changed

tests/Unit/Comment/CommentContainerTest.php

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function provideCommentArray(): array
5656
*
5757
* @dataProvider provideCommentArray
5858
*/
59-
public function getCommentsAfterCommentsAddedToVirginContainerReturnsThoseComments(array $comments): void
59+
public function addCommentsOnVirginContainerAddsCommentsProvided(array $comments): void
6060
{
6161
$this->subject->addComments($comments);
6262

@@ -70,7 +70,7 @@ public function getCommentsAfterCommentsAddedToVirginContainerReturnsThoseCommen
7070
*
7171
* @dataProvider provideCommentArray
7272
*/
73-
public function getCommentsAfterEmptyArrayOfCommentsAddedReturnsOriginalComments(array $comments): void
73+
public function addCommentsWithEmptyArrayKeepsOriginalCommentsUnchanged(array $comments): void
7474
{
7575
$this->subject->setComments($comments);
7676

@@ -148,10 +148,8 @@ private static function createContainsContstraints(array $comments): array
148148
*
149149
* @dataProvider provideTwoDistinctCommentArraysWithSecondNonempty
150150
*/
151-
public function getCommentsAfterCommentsAddedIncludesOriginalComments(
152-
array $commentsToAdd,
153-
array $originalComments
154-
): void {
151+
public function addCommentsKeepsOriginalComments(array $commentsToAdd, array $originalComments): void
152+
{
155153
$this->subject->setComments($originalComments);
156154

157155
$this->subject->addComments($commentsToAdd);
@@ -170,10 +168,8 @@ public function getCommentsAfterCommentsAddedIncludesOriginalComments(
170168
*
171169
* @dataProvider provideTwoDistinctCommentArraysWithSecondNonempty
172170
*/
173-
public function getCommentsAfterCommentsAddedIncludesCommentsAdded(
174-
array $originalComments,
175-
array $commentsToAdd
176-
): void {
171+
public function addCommentsAfterCommentsSetAddsCommentsProvided(array $originalComments, array $commentsToAdd): void
172+
{
177173
$this->subject->setComments($originalComments);
178174

179175
$this->subject->addComments($commentsToAdd);
@@ -210,7 +206,7 @@ public function addCommentsAppends(array $comments): void
210206
*
211207
* @dataProvider provideCommentArray
212208
*/
213-
public function getCommentsAfterCommentsSetOnVirginContainerReturnsThoseComments(array $comments): void
209+
public function setCommentsOnVirginContainerSetsCommentsProvided(array $comments): void
214210
{
215211
$this->subject->setComments($comments);
216212

@@ -225,10 +221,8 @@ public function getCommentsAfterCommentsSetOnVirginContainerReturnsThoseComments
225221
*
226222
* @dataProvider provideTwoDistinctCommentArrays
227223
*/
228-
public function getCommentsAfterCommentsSetOnContainerWithCommentsReturnsOnlyCommentsSet(
229-
array $originalComments,
230-
array $commentsToSet
231-
): void {
224+
public function setCommentsReplacesWithCommentsProvided(array $originalComments, array $commentsToSet): void
225+
{
232226
$this->subject->setComments($originalComments);
233227

234228
$this->subject->setComments($commentsToSet);

0 commit comments

Comments
 (0)