$mock = Mockery::mock(MyClass::class); $mock->shouldReceive('myMethod') ->once() ->with('arg1', 'arg2') ->andReturn('myReturnValue'); $result = $mock->myMethod('arg1', 'arg2'); // $result === 'myReturnValue'This example creates a mock object of the `MyClass` class, and then specifies that the `myMethod` method should be called once with arguments `'arg1'` and `'arg2'`, and should return `'myReturnValue'`. It then calls the `myMethod` method with those arguments and stores the return value in `$result`. The `shouldReceive` function is part of the Mockery package library, which is a PHP library for mocking and testing dependencies.