This repository has been archived on 2020-03-30. You can view files and clone it, but cannot push or open issues or pull requests.
ext-collections/tests/014-drop.phpt

16 lines
440 B
PHP

--TEST--
Test Collection::drop() and Collection::dropLast().
--FILE--
<?php
$collection = Collection::init(['a', 'b', 'c', 'd', 'e']);
$collection1 = $collection->drop(3);
if (array_values($collection1->toArray()) != ['d', 'e']) {
echo 'Collection::drop() failed.', PHP_EOL;
}
$collection1 = $collection->dropLast(2);
if ($collection1->toArray() != ['a', 'b', 'c']) {
echo 'Collection::dropLast() failed.', PHP_EOL;
}
?>
--EXPECT--