What is the difference between overload and alias in Mockery?
I am new to using Mockery and confused with the terminology alias and overload . Can anyone please explain to me when to use which? Overload is used to create an "instance mock". This will "intercept" when a new instance of a class is created and the mock will be used instead. For example if this code is to be tested: class ClassToTest { public function methodToTest() { $myClass = new MyClass(); $result = $myClass->someMethod(); return $result; } } You would create an instance mock using overload and define the expectations like this: public function testMethodToTest() { $mock = Mockery::mock(