Move test helpers into bootstrap.php

This makes the spec much cleaner.