@@ -36,7 +36,7 @@ public static function setUpBeforeClass(): void
36
36
/**
37
37
* @testdox append entries to a list and return the new list -> empty lists
38
38
*/
39
- public function testAppendEmptyLists ()
39
+ public function testAppendEntriesToAListAndReturnTheNewListWithEmptyLists ()
40
40
{
41
41
$ listOps = new ListOps ();
42
42
$ this ->assertEquals ([], $ listOps ->append ([], []));
@@ -45,25 +45,25 @@ public function testAppendEmptyLists()
45
45
/**
46
46
* @testdox append entries to a list and return the new list -> list to empty list
47
47
*/
48
- public function testAppendNonEmptyListToEmptyList ()
48
+ public function testAppendEntriesToAListAndReturnTheNewListWithListToEmptyList ()
49
49
{
50
50
$ listOps = new ListOps ();
51
- $ this ->assertEquals ([1 , 2 , 3 , 4 ], $ listOps ->append ([1 , 2 , 3 , 4 ], [ ]));
51
+ $ this ->assertEquals ([1 , 2 , 3 , 4 ], $ listOps ->append ([], [ 1 , 2 , 3 , 4 ]));
52
52
}
53
53
54
54
/**
55
55
* @testdox append entries to a list and return the new list -> empty list to list
56
56
*/
57
- public function testAppendEmptyListToNonEmptyList ()
57
+ public function testAppendEntriesToAListAndReturnTheNewListWithEmptyListToList ()
58
58
{
59
59
$ listOps = new ListOps ();
60
- $ this ->assertEquals ([1 , 2 , 3 , 4 ], $ listOps ->append ([], [ 1 , 2 , 3 , 4 ]));
60
+ $ this ->assertEquals ([1 , 2 , 3 , 4 ], $ listOps ->append ([1 , 2 , 3 , 4 ], [ ]));
61
61
}
62
62
63
63
/**
64
64
* @testdox append entries to a list and return the new list -> non-empty lists
65
65
*/
66
- public function testAppendNonEmptyLists ()
66
+ public function testAppendEntriesToAListAndReturnTheNewListWithNonEmptyLists ()
67
67
{
68
68
$ listOps = new ListOps ();
69
69
$ this ->assertEquals ([1 , 2 , 2 , 3 , 4 , 5 ], $ listOps ->append ([1 , 2 ], [2 , 3 , 4 , 5 ]));
@@ -72,16 +72,16 @@ public function testAppendNonEmptyLists()
72
72
/**
73
73
* @testdox concatenate a list of lists -> empty list
74
74
*/
75
- public function testConcatEmptyLists ()
75
+ public function testConcatenateAListOfListsWithEmptyList ()
76
76
{
77
77
$ listOps = new ListOps ();
78
- $ this ->assertEquals ([], $ listOps ->concat ([], [] ));
78
+ $ this ->assertEquals ([], $ listOps ->concat ());
79
79
}
80
80
81
81
/**
82
82
* @testdox concatenate a list of lists -> list of lists
83
83
*/
84
- public function testConcatLists ()
84
+ public function testConcatenateAListOfListsWithListOfLists ()
85
85
{
86
86
$ listOps = new ListOps ();
87
87
$ this ->assertEquals ([1 , 2 , 3 , 4 , 5 , 6 ], $ listOps ->concat ([1 , 2 ], [3 ], [], [4 , 5 , 6 ]));
@@ -90,7 +90,7 @@ public function testConcatLists()
90
90
/**
91
91
* @testdox concatenate a list of lists -> list of nested lists
92
92
*/
93
- public function testConcatNestedLists ()
93
+ public function testConcatenateAListOfListsWithListOfNestedLists ()
94
94
{
95
95
$ listOps = new ListOps ();
96
96
$ this ->assertEquals ([[1 ], [2 ], [3 ], [], [4 , 5 , 6 ]], $ listOps ->concat ([[1 ], [2 ]], [[3 ]], [[]], [[4 , 5 , 6 ]]));
@@ -99,7 +99,7 @@ public function testConcatNestedLists()
99
99
/**
100
100
* @testdox filter list returning only values that satisfy the filter function -> empty list
101
101
*/
102
- public function testFilterEmptyList ()
102
+ public function testFilterListReturningOnlyValuesThatSatisfyTheFilterFunctionWithEmptyList ()
103
103
{
104
104
$ listOps = new ListOps ();
105
105
$ this ->assertEquals (
@@ -109,9 +109,9 @@ public function testFilterEmptyList()
109
109
}
110
110
111
111
/**
112
- * @testdox filter list returning only values that satisfy the filter function -> non empty list
112
+ * @testdox filter list returning only values that satisfy the filter function -> non- empty list
113
113
*/
114
- public function testFilterNonEmptyList ()
114
+ public function testFilterListReturningOnlyValuesThatSatisfyTheFilterFunctionWithNonEmptyList ()
115
115
{
116
116
$ listOps = new ListOps ();
117
117
$ this ->assertEquals (
@@ -123,7 +123,7 @@ public function testFilterNonEmptyList()
123
123
/**
124
124
* @testdox returns the length of a list -> empty list
125
125
*/
126
- public function testLengthEmptyList ()
126
+ public function testReturnsTheLengthOfAListWithEmptyList ()
127
127
{
128
128
$ listOps = new ListOps ();
129
129
$ this ->assertEquals (0 , $ listOps ->length ([]));
@@ -132,16 +132,16 @@ public function testLengthEmptyList()
132
132
/**
133
133
* @testdox returns the length of a list -> non-empty list
134
134
*/
135
- public function testLengthNonEmptyList ()
135
+ public function testReturnsTheLengthOfAListWithNonEmptyList ()
136
136
{
137
137
$ listOps = new ListOps ();
138
138
$ this ->assertEquals (4 , $ listOps ->length ([1 , 2 , 3 , 4 ]));
139
139
}
140
140
141
141
/**
142
- * @testdox returns a list of elements whose values equal the list value transformed by the mapping function -> empty list
142
+ * @testdox return a list of elements whose values equal the list value transformed by the mapping function -> empty list
143
143
*/
144
- public function testMapEmptyList ()
144
+ public function testReturnAListOfElementsWhoseValuesEqualTheListValueTransformedByTheMappingFunctionWithEmptyList ()
145
145
{
146
146
$ listOps = new ListOps ();
147
147
$ this ->assertEquals (
@@ -151,9 +151,9 @@ public function testMapEmptyList()
151
151
}
152
152
153
153
/**
154
- * @testdox returns a list of elements whose values equal the list value transformed by the mapping function -> non-empty list
154
+ * @testdox return a list of elements whose values equal the list value transformed by the mapping function -> non-empty list
155
155
*/
156
- public function testMapNonEmptyList ()
156
+ public function testReturnAListOfElementsWhoseValuesEqualTheListValueTransformedByTheMappingFunctionWithNonEmptyList ()
157
157
{
158
158
$ listOps = new ListOps ();
159
159
$ this ->assertEquals (
@@ -165,7 +165,7 @@ public function testMapNonEmptyList()
165
165
/**
166
166
* @testdox folds (reduces) the given list from the left with a function -> empty list
167
167
*/
168
- public function testFoldlEmptyList ()
168
+ public function testFoldsReducesTheGivenListFromTheLeftWithAFunctionWithEmptyList ()
169
169
{
170
170
$ listOps = new ListOps ();
171
171
$ this ->assertEquals (
@@ -177,19 +177,19 @@ public function testFoldlEmptyList()
177
177
/**
178
178
* @testdox folds (reduces) the given list from the left with a function -> direction independent function applied to non-empty list
179
179
*/
180
- public function testFoldlDirectionIndependentNonEmptyList ()
180
+ public function testFoldsReducesTheGivenListFromTheLeftWithAFunctionWithDirectionIndependentFunctionAppliedToNonEmptyList ()
181
181
{
182
182
$ listOps = new ListOps ();
183
183
$ this ->assertEquals (
184
184
15 ,
185
- $ listOps ->foldl (static fn ($ acc , $ el ) => $ acc + $ el , [1 , 2 , 3 , 4 ], 5 )
185
+ $ listOps ->foldl (static fn ($ acc , $ el ) => $ el + $ acc , [1 , 2 , 3 , 4 ], 5 )
186
186
);
187
187
}
188
188
189
189
/**
190
190
* @testdox folds (reduces) the given list from the left with a function -> direction dependent function applied to non-empty list
191
191
*/
192
- public function testFoldlDirectionDependentNonEmptyList ()
192
+ public function testFoldsReducesTheGivenListFromTheLeftWithAFunctionWithDirectionDependentFunctionAppliedToNonEmptyList ()
193
193
{
194
194
$ listOps = new ListOps ();
195
195
$ this ->assertEquals (
@@ -201,61 +201,54 @@ public function testFoldlDirectionDependentNonEmptyList()
201
201
/**
202
202
* @testdox folds (reduces) the given list from the right with a function -> empty list
203
203
*/
204
- public function testFoldrEmptyList ()
204
+ public function testFoldsReducesTheGivenListFromTheRightWithAFunctionWithEmptyList ()
205
205
{
206
206
$ listOps = new ListOps ();
207
207
$ this ->assertEquals (
208
208
2 ,
209
209
$ listOps ->foldr (static fn ($ acc , $ el ) => $ el * $ acc , [], 2 )
210
210
);
211
211
}
212
-
213
212
/**
214
213
* @testdox folds (reduces) the given list from the right with a function -> direction independent function applied to non-empty list
215
214
*/
216
- public function testFoldrDirectionIndependentNonEmptyList ()
215
+ public function testFoldsReducesTheGivenListFromTheRightWithAFunctionWithDirectionIndependentFunctionAppliedToNonEmptyList ()
217
216
{
218
217
$ listOps = new ListOps ();
219
218
$ this ->assertEquals (
220
219
15 ,
221
- $ listOps ->foldr (static fn ($ acc , $ el ) => $ acc + $ el , [1 , 2 , 3 , 4 ], 5 )
220
+ $ listOps ->foldr (static fn ($ acc , $ el ) => $ el + $ acc , [1 , 2 , 3 , 4 ], 5 )
222
221
);
223
222
}
224
-
225
223
/**
226
224
* @testdox folds (reduces) the given list from the right with a function -> direction dependent function applied to non-empty list
227
225
*/
228
- public function testFoldrDirectionDependentNonEmptyList ()
226
+ public function testFoldsReducesTheGivenListFromTheRightWithAFunctionWithDirectionDependentFunctionAppliedToNonEmptyList ()
229
227
{
230
228
$ listOps = new ListOps ();
231
229
$ this ->assertEquals (
232
230
9 ,
233
231
$ listOps ->foldr (static fn ($ acc , $ el ) => $ el / $ acc , [1 , 2 , 3 , 4 ], 24 )
234
232
);
235
233
}
236
-
237
- /**
238
- * @testdox reverse the elements of a list -> empty list
234
+ /**
235
+ * @testdox reverse the elements of the list -> empty list
239
236
*/
240
- public function testReverseEmptyList ()
237
+ public function testReverseTheElementsOfTheListWithEmptyList ()
241
238
{
242
239
$ listOps = new ListOps ();
243
240
$ this ->assertEquals ([], $ listOps ->reverse ([]));
244
- }
245
-
246
- /**
247
- * @testdox reverse the elements of a list -> non-empty list
241
+ } /**
242
+ * @testdox reverse the elements of the list -> non-empty list
248
243
*/
249
- public function testReverseNonEmptyList ()
244
+ public function testReverseTheElementsOfTheListWithNonEmptyList ()
250
245
{
251
246
$ listOps = new ListOps ();
252
247
$ this ->assertEquals ([7 , 5 , 3 , 1 ], $ listOps ->reverse ([1 , 3 , 5 , 7 ]));
253
- }
254
-
255
- /**
256
- * @testdox reverse the elements of a list -> list of lists is not flattened
248
+ } /**
249
+ * @testdox reverse the elements of the list -> list of lists is not flattened
257
250
*/
258
- public function testReverseNonEmptyListIsNotFlattened ()
251
+ public function testReverseTheElementsOfTheListWithListOfListsIsNotFlattened ()
259
252
{
260
253
$ listOps = new ListOps ();
261
254
$ this ->assertEquals ([[4 , 5 , 6 ], [], [3 ], [1 , 2 ]], $ listOps ->reverse ([[1 , 2 ], [3 ], [], [4 , 5 , 6 ]]));
0 commit comments