Skip to content

Commit

Permalink
tests: Reproduce issue in a test.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Dec 30, 2020
1 parent 739e9c6 commit f09ae23
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/loophp/collection/CollectionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -3034,6 +3034,34 @@ public function it_can_zip(): void
->shouldIterateAs([[1, 'A'], [2, 'B'], [3, 'C'], [4, 'D'], [5, 'E']]);
}

/**
* @see https://github.com/loophp/collection/issues/57
*/
public function it_fix_bug_57()
{
$input = array_combine(range(1, 26), range('a', 'z'));

$collection = $this::fromIterable($input);

$collection
->key()
->shouldReturn(1);

$collection
->current()
->shouldReturn('a');

$last = $collection->last();

$last
->key()
->shouldReturn(26);

$last
->current()
->shouldReturn('z');
}

public function it_is_initializable(): void
{
$this->shouldHaveType(Collection::class);
Expand Down

0 comments on commit f09ae23

Please sign in to comment.