Class: MemberFunctionStub

Represents an object that allows stubbing member function invocations.

Constructor

Gets invoked during the stub registration.

init (object{}  mockObject)
  • mockObject object{}
  • Object to register

Methods

withArguments

Sets the arguments list to consider when stubbing the function call.

thenReturn

Sets the value to be returned when the function is called.

thenReturnSequence

Sets the values to be returned when the function is called repeatedly.

doNothing

Sets the function behavior to do nothing when called.

withArguments

function withArguments(anydata | error... args) returns MemberFunctionStub
Isolated Function

Sets the arguments list to consider when stubbing the function call.

Parameters

  • args anydata | error...
  • Arguments list

Return Type

(MemberFunctionStub)

Object that allows stubbing calls to provided member function

thenReturn

function thenReturn(any | error returnValue)
Isolated Function

Sets the value to be returned when the function is called.

Parameters

  • returnValue any | error
  • Value or error to return

thenReturnSequence

function thenReturnSequence(any | error... returnValues)
Isolated Function

Sets the values to be returned when the function is called repeatedly.

Parameters

  • returnValues any | error...
  • Value or error to return

doNothing

function doNothing()
Isolated Function

Sets the function behavior to do nothing when called.