“It's called the Onion Architecture and its main principal is this: organize the layers of your application code like the layers of an onion. Every layer of the onion is only coupled (or dependent upon) any layer deeper in the onion than itself.” –Kristopher Wilson http://kristopherwilson.com/2013/07/04/implementing-the-onion- architecture-in-php/
The Law of Demeter “The Law of Demeter for functions states that any method of an object should call only methods belonging to itself, any parameters that were passed in to the method, any objects it created, and any directly held component objects.”
“I suggest never testing private or protected methods directly. Instead, test public methods and use code coverage information to make sure they are executed.” –Chris Hartjes