You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ChunkedItemsIteratorTest.php
+9-33
Original file line number
Diff line number
Diff line change
@@ -13,14 +13,9 @@
13
13
14
14
namespaceWebmozarts\Console\Parallelization;
15
15
16
-
useClosure;
17
16
usefunctionfclose;
18
-
usefunctionfopen;
19
-
usefunctionfwrite;
20
17
useInvalidArgumentException;
21
-
useLogicException;
22
18
usePHPUnit\Framework\TestCase;
23
-
usefunctionrewind;
24
19
usestdClass;
25
20
26
21
/**
@@ -164,27 +159,27 @@ public static function valuesProvider(): iterable
164
159
publicstaticfunctionstreamProvider(): iterable
165
160
{
166
161
yield'single item' => [
167
-
self::createStream('item0'),
162
+
StringStream::fromString('item0'),
168
163
['item0'],
169
164
];
170
165
171
166
yield'single item with space' => [
172
-
self::createStream('it em'),
167
+
StringStream::fromString('it em'),
173
168
['it em'],
174
169
];
175
170
176
171
yield'empty string' => [
177
-
self::createStream(''),
172
+
StringStream::fromString(''),
178
173
[],
179
174
];
180
175
181
176
yield'whitespace string' => [
182
-
self::createStream(''),
177
+
StringStream::fromString(''),
183
178
[''],
184
179
];
185
180
186
181
yield'several items' => [
187
-
self::createStream(<<<'STDIN'
182
+
StringStream::fromString(<<<'STDIN'
188
183
item0
189
184
item1
190
185
item3
@@ -193,7 +188,7 @@ public static function streamProvider(): iterable
193
188
];
194
189
195
190
yield'several items with blank values' => [
196
-
self::createStream(<<<'STDIN'
191
+
StringStream::fromString(<<<'STDIN'
197
192
item0
198
193
item1
199
194
@@ -205,7 +200,7 @@ public static function streamProvider(): iterable
205
200
];
206
201
207
202
yield'numerical items – items are kept as strings' => [
208
-
self::createStream(<<<'STDIN'
203
+
StringStream::fromString(<<<'STDIN'
209
204
string item
210
205
10
211
206
.5
@@ -220,7 +215,7 @@ public static function inputProvider(): iterable
220
215
{
221
216
yield'one item: the fetch item closure is not evaluated' => [
222
217
'item0',
223
-
self::createFakeClosure(),
218
+
FakeCallable::create(),
224
219
['item0'],
225
220
];
226
221
@@ -240,7 +235,7 @@ public static function invalidValuesProvider(): iterable
240
235
];
241
236
242
237
yield'closure item' => [
243
-
[self::createFakeClosure()],
238
+
[FakeCallable::create()],
244
239
1,
245
240
'The items are potentially passed to the child processes via the STDIN. For this reason they are expected to be string values. Got "Closure" for the item "0".',
246
241
];
@@ -252,25 +247,6 @@ public static function invalidValuesProvider(): iterable
252
247
];
253
248
}
254
249
255
-
privatestaticfunctioncreateFakeClosure(): Closure
256
-
{
257
-
returnstaticfunction () {
258
-
thrownewLogicException('Did not expect to be called');
0 commit comments