# Namespace goog.testing.MethodMock

code »

Mocks an existing function. Creates a goog.testing.FunctionMock and registers it in the given scope with the name specified by functionName.

## Main

MethodMock ( scope, functionName, opt_strictness ) ⇒ `!goog.testing.MockInterface`

Parameters

scope: `Object`
  The scope of the method to be mocked out.
functionName: `string`
  The name of the function we're going to mock.
opt_strictness: `number=`
  One of goog.testing.Mock.LOOSE or goog.testing.Mock.STRICT. The default is STRICT.

Returns

The mocked method.

Show:Public Protected Private

## Global Functions

code »goog.testing.MethodMock.$tearDown ( )

Resets the global function that we mocked back to its original state.