1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29:
<?php
namespace Guzzle\Tests\Iterator;
use Guzzle\Iterator\MapIterator;
class MapIteratorTest extends \PHPUnit_Framework_TestCase
{
public function testFiltersValues()
{
$i = new MapIterator(new \ArrayIterator(range(0, 100)), function ($value) {
return $value * 10;
});
$this->assertEquals(range(0, 1000, 10), iterator_to_array($i, false));
}
public function testValidatesCallable()
{
$i = new MapIterator(new \ArrayIterator(), new \stdClass());
}
}