Skip to content

Commit

Permalink
[9.x] Improve test for values method in Collection (#43423)
Browse files Browse the repository at this point in the history
The values method returns the keys reset to consecutive integers
  • Loading branch information
moharami committed Jul 26, 2022
1 parent d1a4473 commit 1c15b40
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Support/SupportCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,15 @@ public function testValues($collection)
})->values()->all());
}

/**
* @dataProvider collectionClassProvider
*/
public function testValuesResetKey($collection)
{
$data = new $collection([1 => 'a', 2 => 'b', 3 => 'c']);
$this->assertEquals([0 => 'a', 1 => 'b', 2 => 'c'], $data->values()->all());
}

/**
* @dataProvider collectionClassProvider
*/
Expand Down

0 comments on commit 1c15b40

Please sign in to comment.