Mocking is a fundamental skill in testing. It allows you to avoid testing parts of your code that are outside your control, or to get reliable return values from said code.
This is a simple process, yet I had a more difficult time than I'd like trying to find the information not scattered in bits and pieces around the web.