matlab.mock.InteractionHistory.forMock
Class: matlab.mock.InteractionHistory
Namespace: matlab.mock
Return history from mock object
Description
history = matlab.mock.InteractionHistory.forMock(
returns the history from a mock object. mock
)history
is an array of matlab.mock.InteractionHistory
objects. Each element in history
corresponds to one method call, property access, or property modification. The array elements are ordered, with the first element indicating the first recorded interaction. This method returns interactions with publicly visible methods and properties only. For example, the following interactions are not recorded:
Calls to
Hidden
methodsCalls to
Sealed
superclass methodsAccesses or modifications of concrete superclass properties
Input Arguments
Examples
Alternatives
You can obtain the same history of interactions using the getMockHistory
method on a matlab.mock.TestCase
instance. For example, if you have a matlab.mock.TestCase
instance tc
, and a mock object mock
, the following method calls are equivalent.
h = matlab.mock.InteractionHistory.forMock(mock); h = tc.getMockHistory(mock);
However, you do not need access to the matlab.mock.TestCase
instance to use the forMock
method.
Version History
Introduced in R2018a