File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Tests/Unit-Tests/NewRelicAgentTests/Analytics-Tests Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1414#import " NRMACustomEvent.h"
1515#import " NRMARequestEvent.h"
1616#import " NRMAInteractionEvent.h"
17+ #import " NewRelicAgentInternal.h"
18+ #import < OCMock/OCMock.h>
1719
1820#import " BlockAttributeValidator.h"
1921#import " NRMAFlags.h"
@@ -65,8 +67,12 @@ - (nullable instancetype)initWithCoder:(nonnull NSCoder *)coder {
6567@end
6668
6769@interface PersistentStoreTests : XCTestCase
70+ @property id mockNewRelicInternals;
71+
6872@end
6973
74+ static NewRelicAgentInternal* _sharedInstance;
75+
7076@implementation PersistentStoreTests {
7177 BlockAttributeValidator *agreeableAttributeValidator;
7278}
@@ -77,7 +83,11 @@ @implementation PersistentStoreTests {
7783
7884- (void )setUp {
7985 [super setUp ];
80-
86+ self.mockNewRelicInternals = [OCMockObject mockForClass: [NewRelicAgentInternal class ]];
87+ _sharedInstance = [[NewRelicAgentInternal alloc ] init ];
88+ _sharedInstance.analyticsController = [[NRMAAnalytics alloc ] initWithSessionStartTimeMS: 0.0 ];
89+ [[[[self .mockNewRelicInternals stub ] classMethod ] andReturn: _sharedInstance] sharedInstance ];
90+
8191 if (agreeableAttributeValidator == nil ) {
8292 agreeableAttributeValidator = [[BlockAttributeValidator alloc ] initWithNameValidator: ^BOOL (NSString *) {
8393 return YES ;
You can’t perform that action at this time.
0 commit comments