Esempio n. 1
0
require_once dirname(__FILE__) . '/../../bootstrap/unit.php';
$t = new lime_test(2);
class myPager extends sfPager
{
    function init()
    {
    }
    function retrieveObject($offset)
    {
    }
    function getResults()
    {
        $this->setNbResults(2);
        return array("foo", "bar");
    }
}
$pager = new myPager("fooClass");
// #8021
// ->rewind()
$t->diag('->rewind()');
$countRuns = 0;
foreach ($pager as $item) {
    $countRuns++;
}
$t->is($countRuns, $pager->count(), 'iterating first time will invoke on all items');
$countRuns = 0;
$pager->rewind();
foreach ($pager as $item) {
    $countRuns++;
}
$t->is($countRuns, $pager->count(), '->rewind will allow reiterating');