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