public function testExceptionIsThrownInIterator($functionName) { $this->setExpectedException('DomainException', 'Callback exception'); $functionName($this->listIterator, [$this, 'exception']); }