If a function satisfies a special Morera-type inequality with respect to a diferentiation basis, then it is quasiregular. The results is based on a Morera-type criterion for belonging to the Sobolev space.