Issue #3458422 by mstrelan, smustgrave: Add string return typehints to protected test helper methods (cherry picked from commit 22e2a128)