Fix the test helper deprecations under 4.0 and 3.0