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/031-partition.phpt

14 lines
330 B
PHP

--TEST--
Test Collection::partition().
--FILE--
<?php
$array = ['abc', 'd', 'ef', 'ghij'];
$pair = Collection::init($array)->partition(function ($value) {
return strlen($value) % 2;
});
if ($pair->first != ['abc', 'd'] || $pair->second != ['ef', 'ghij']) {
echo 'Collection::partition() failed.', PHP_EOL;
}
?>
--EXPECT--