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
Plaintext
Raw Permalink Normal View History

2018-03-29 04:33:39 +00:00
--TEST--
Test Collection::copyOf();
--FILE--
<?php
2018-09-05 16:00:15 +00:00
$array = ['a' => 2, 3 => 'd', 'e' => 'f'.strval(2)];
2018-03-29 04:33:39 +00:00
$collection = Collection::init($array);
$collection1 = $collection->copyOf(2);
2018-08-28 14:11:09 +00:00
if ($collection1->toArray() != array_slice($array, 0, 2, true)) {
2018-03-29 04:33:39 +00:00
echo 'Collection::copyOf() failed.', PHP_EOL;
2018-08-28 14:11:09 +00:00
}
$collection1 = $collection->copyOf();
if ($collection1->toArray() != $array) {
echo 'Collection::copyOf() failed.', PHP_EOL;
}
2018-03-29 04:33:39 +00:00
?>
--EXPECT--