File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,8 @@ - (void)testObjectNotFoundWhenSave {
33
33
#if TARGET_OS_IOS
34
34
// enable LDS
35
35
[[Parse _currentManager ]loadOfflineStoreWithOptions:0 ];
36
+ PFOfflineStore *offlineStoreSpy = PFPartialMock ([Parse _currentManager ].offlineStore );
37
+ [Parse _currentManager ].offlineStore = offlineStoreSpy;
36
38
37
39
// create and save installation
38
40
PFInstallation *installation = [PFInstallation currentInstallation ];
@@ -44,7 +46,7 @@ - (void)testObjectNotFoundWhenSave {
44
46
id commandRunner = PFStrictProtocolMock (@protocol (PFCommandRunning));
45
47
[Parse _currentManager ].commandRunner = commandRunner;
46
48
47
- BFTask *mockedTask = [BFTask taskWithError: [NSError errorWithDomain: @" " code: kPFErrorObjectNotFound userInfo: nil ]];
49
+ BFTask *mockedTask = [BFTask taskWithError: [NSError errorWithDomain: @" Object Not Found " code: kPFErrorObjectNotFound userInfo: nil ]];
48
50
49
51
__block int callCount = 0 ;
50
52
OCMStub ([commandRunner runCommandAsync: [OCMArg any ] withOptions: PFCommandRunningOptionRetryIfFailed])
@@ -57,6 +59,8 @@ - (void)testObjectNotFoundWhenSave {
57
59
[installation save ];
58
60
OCMVerifyAll (commandRunner);
59
61
XCTAssertEqual (2 , callCount);
62
+ OCMVerify ([offlineStoreSpy updateObjectIdForObject: installation oldObjectId: nil newObjectId: @" abc" ]);
63
+ OCMVerify ([offlineStoreSpy updateObjectIdForObject: installation oldObjectId: @" abc" newObjectId: nil ]);
60
64
#endif
61
65
}
62
66
You can’t perform that action at this time.
0 commit comments