Skip to content

Instantly share code, notes, and snippets.

View philipobenito's full-sized avatar

Phil Bennett philipobenito

  • Barnsley, Yorkshire, England
View GitHub Profile
<?php
function mockIteratorItems(\Iterator $iterator, array $items, $includeCallsToKey = false)
{
$iterator->expects($this->at(0))->method('rewind');
$counter = 1;
foreach ($items as $k => $v) {
$iterator->expects($this->at($counter++))->method('valid')->will($this->returnValue(true));