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
462 B
PHP

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