For this answer I'm assuming you don't actually want to mock the getDictionaryFromData:
method. I assume you want to test its implementation, how it deal with an error case.
You can stub that JSONObjectWithData:options:error:
method and return an error in the pass by ref argument; somehow like this:
id serializerMock = [OCMock mockForClass:[NSJSONSerialization class]];
NSError *theError = /* create an error */
[[[serializerMock stub] andReturn:nil] JSONObjectWithData:data
options:NSJSONReadingAllowFragments error:[OCMArg setTo:theError]];
The trick here is obviously the setTo:
method.