@@ 70-78 (lines=9) @@ | ||
67 | $this->toArray()->shouldReturn([1, 2, 3]); |
|
68 | } |
|
69 | ||
70 | function it_can_be_instantiated_from_callable_returning_a_generator() |
|
71 | { |
|
72 | $this->beConstructedWith(function () { |
|
73 | foreach ([1, 2, 3] as $value) { |
|
74 | yield $value; |
|
75 | } |
|
76 | }); |
|
77 | $this->toArray()->shouldReturn([1, 2, 3]); |
|
78 | } |
|
79 | ||
80 | function it_will_throw_when_passed_callable_will_return_something_other_than_array_or_traversable() |
|
81 | { |
|
@@ 568-575 (lines=8) @@ | ||
565 | ->shouldReturn([2, 3, 3, 1]); |
|
566 | } |
|
567 | ||
568 | function it_can_return_only_first_x_elements() |
|
569 | { |
|
570 | $this->beConstructedWith([1, 3, 3, 2,]); |
|
571 | ||
572 | $this->take(2) |
|
573 | ->toArray() |
|
574 | ->shouldReturn([1, 3]); |
|
575 | } |
|
576 | ||
577 | function it_can_skip_first_x_elements() |
|
578 | { |