Sort results to make sure assert work on consistent order

Fixes https://github.com/owncloud/core/issues/12824

Please review @icewind1991 @LukasReschke @DeepDiver1975