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/010-copy-of.phpt

17 lines
446 B
PHP

--TEST--
Test Collection::copyOf();
--FILE--
<?php
$array = ['a' => 2, 3 => 'd', 'e' => 'f'.strval(2)];
$collection = Collection::init($array);
$collection1 = $collection->copyOf(2);
if ($collection1->toArray() != array_slice($array, 0, 2, true)) {
echo 'Collection::copyOf() failed.', PHP_EOL;
}
$collection1 = $collection->copyOf();
if ($collection1->toArray() != $array) {
echo 'Collection::copyOf() failed.', PHP_EOL;
}
?>
--EXPECT--