A brief description of public, private and protected:
- public: Accessible by other classes
- private: Not accessible by other classes
- protected: Not accessible by other classes but accessible by derived classes
Reading resources about object oriented programming the logic is to avoid public methods as much as possible.
That's not entirely true. If a method is only used within your class and it's not part of the interface exposed by your class then of course that method needs to be private (or protected if you intend to extend your class). Public methods are part of the interface, they are methods that are designed to be called by other classes. You should not force yourself to limit the use of public methods. If a class needs a lot of public methods then it should have them. Just don't expose the inner mechanics of a class to the outside world and you will be fine.
About testing, private and protected methods can be tested with the use of Reflection. Reflection makes it possible to change the accessor of a method from private to public for testing purposes and much more. Read more about reflection here