| @@ 62-68 (lines=7) @@ | ||
| 59 | // set iterable in the __constructor |
|
| 60 | $result = $this |
|
| 61 | ->taskForEach($items) |
|
| 62 | ->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) { |
|
| 63 | $builder->addCode(function () use ($key, $value, &$actual) { |
|
| 64 | $actual[] = "$key = $value"; |
|
| 65 | ||
| 66 | return 0; |
|
| 67 | }); |
|
| 68 | }) |
|
| 69 | ->run(); |
|
| 70 | $this->assertTrue($result->wasSuccessful()); |
|
| 71 | ||
| @@ 94-100 (lines=7) @@ | ||
| 91 | $this |
|
| 92 | ->taskForEach() |
|
| 93 | ->deferTaskConfiguration('setIterable', 'items') |
|
| 94 | ->withBuilder(function (CollectionBuilder $builder, $key, $value) use (&$actual) { |
|
| 95 | $builder->addCode(function () use ($key, $value, &$actual) { |
|
| 96 | $actual[] = "$key = $value"; |
|
| 97 | ||
| 98 | return 0; |
|
| 99 | }); |
|
| 100 | }) |
|
| 101 | ) |
|
| 102 | ->run(); |
|
| 103 | $this->assertTrue($result->wasSuccessful()); |
|