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/005-associate.phpt

14 lines
345 B
PHP

--TEST--
Test Collection::associate().
--FILE--
<?php
$array = ['foo' => 'bar', 34 => 5];
$collection = Collection::init($array);
$collection1 = $collection->associate(function ($value, $key) {
return new Pair($value, $key);
});
if ($collection1->toArray() != array_flip($array))
echo 'Collection::all() failed.', PHP_EOL;
?>
--EXPECT--