Skip to content

Commit 1c15b40

Browse files
authored
[9.x] Improve test for values method in Collection (#43423)
The values method returns the keys reset to consecutive integers
1 parent d1a4473 commit 1c15b40

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Support/SupportCollectionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,15 @@ public function testValues($collection)
11611161
})->values()->all());
11621162
}
11631163

1164+
/**
1165+
* @dataProvider collectionClassProvider
1166+
*/
1167+
public function testValuesResetKey($collection)
1168+
{
1169+
$data = new $collection([1 => 'a', 2 => 'b', 3 => 'c']);
1170+
$this->assertEquals([0 => 'a', 1 => 'b', 2 => 'c'], $data->values()->all());
1171+
}
1172+
11641173
/**
11651174
* @dataProvider collectionClassProvider
11661175
*/

0 commit comments

Comments
 (0)