Backport StepMockHelper

Original 5.1 rev. 5bcb52c