Mocks `open` method