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