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/032-reverse-reversed.phpt

14 lines
399 B
PHP

--TEST--
Test Collection::reverse() and Collection::reversed().
--FILE--
<?php
$array = ['a', 'b', 'c', 'd', 'e'];
$collection = Collection::init($array);
$collection->reverse();
if ($collection->toArray() != array_reverse($array))
echo 'Collection::reverse() failed.', PHP_EOL;
if ($collection->reversed()->toArray() != $array)
echo 'Collection::reversed() failed.', PHP_EOL;
?>
--EXPECT--