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