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

14 lines
454 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);
$collection2 = $collection->dropLast(3);
if ($collection1->toArray() != ['e' => 'f', 1 => 12, 2 => 34])
echo 'Collection::drop() failed.', PHP_EOL;
if ($collection2->toArray() != ['ab' => 'c', 'd'])
echo 'Collection::dropLast() failed.', PHP_EOL;
?>
--EXPECT--