id protocolMock = OCMProtocolMock(@protocol(SomeProtocol));
Will create a mock object that can be used as if it were an instance of an object that implements SomeProtocol.
Does OCMock provide a way to create a mock object that implements several protocols?
In your test file, you can create a new protocol that implements the multiple ones you need:
@protocol MyTestProtocol <MyProtocolA, MyProtocolB>
@end
and then mock it:
id protocolMock = OCMProtocolMock(@protocol(MyTestProtocol));
This is currently not supported in OCMock. If you think this is a feature that really should be added, please log an issue on Github (https://github.com/erikdoe/ocmock/issues).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With