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