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