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.
2018-05-14 08:20:07 +00:00
|
|
|
--TEST--
|
|
|
|
Test Collection::reverse() and Collection::reversed().
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$array = ['a', 'b', 'c', 'd', 'e'];
|
|
|
|
$collection = Collection::init($array);
|
|
|
|
$collection->reverse();
|
2018-08-28 14:11:09 +00:00
|
|
|
if ($collection->toArray() != array_reverse($array)) {
|
2018-05-14 08:20:07 +00:00
|
|
|
echo 'Collection::reverse() failed.', PHP_EOL;
|
2018-08-28 14:11:09 +00:00
|
|
|
}
|
|
|
|
if ($collection->reversed()->toArray() != $array) {
|
2018-05-14 08:20:07 +00:00
|
|
|
echo 'Collection::reversed() failed.', PHP_EOL;
|
2018-08-28 14:11:09 +00:00
|
|
|
}
|
2018-05-14 08:20:07 +00:00
|
|
|
?>
|
|
|
|
--EXPECT--
|