building are more and more complex. We press one button and get a result, but a million things happen behind the scenes. If something goes wrong, you don't want to get one of those "Sorry, an error occurred!" messages. You want to know exactly what happened. Good unit tests will give you that.
the system we are building before we build it. As we build it we will probably want to change things. Good unit tests allow us to safely change our code without breaking anything that came before.
ok. class MyPlugin { public $getter; public function __construct( $getter ) { $this->getter = $getter; } public static function get_instance() { return new MyPlugin( new Getter() ); } } They don't always need to be tested because we can test the object creation manually.
ok. class MyPlugin { public static function is_published_post( $post ) { return $post->post_status === 'publish'; } } These can be tested without mocks.
doesn't really say what it does. process_my_shortcode is better, but still ambiguous about what the function returns. get_markup_from_shortcode tells us what the input and output will be.
of lines of code, if a unit test fails, you only need to search that small unit under test to find the bug." https://googletesting.blogspot.co.uk/2015/04/just-say-no-to-more-end-to-end-tests.html