Problem with mocking of existing static methods

$this is used in mocks, created for existing static method.

Related issue: #175