Testing using measurement invariance