add persist checks to phpunit test base class to reduce sequential db calls