Is there a way to dynamically make functions public in the child class?

I have an interface class that is used for API, and most of the functions are protected.
So when I do unit test on these, I normally create a child test class from the target class I want to test, and overwrite the visibility of the parent class’ functions for testing.

My question is if there is a way to simplify this by doing this dynamically, which would simplify the maintenance? Let’s say in the tester class’ constructor – or any other way?