Skip to content

Commit 885f296

Browse files
Update Database tests to run against the emulator (#5650)
1 parent 0cf5999 commit 885f296

File tree

15 files changed

+213
-63
lines changed

15 files changed

+213
-63
lines changed

Example/Database/Tests/Helpers/FDevice.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
@interface FDevice () {
2929
FIRDatabaseConfig *config;
30+
FIRDatabase *database;
3031
NSString *url;
3132
BOOL isOnline;
3233
BOOL disposed;
@@ -63,6 +64,7 @@ - (id)initWithUrl:(NSString *)firebaseUrl andOnline:(BOOL)online {
6364
config.persistenceEnabled = YES;
6465
url = firebaseUrl;
6566
isOnline = online;
67+
database = [FTestHelpers databaseForConfig:self->config];
6668
}
6769
return self;
6870
}
@@ -92,13 +94,15 @@ - (void)goOnline {
9294
- (void)restartOnline {
9395
@autoreleasepool {
9496
[FRepoManager disposeRepos:config];
97+
database = [FTestHelpers databaseForConfig:self->config];
9598
isOnline = YES;
9699
}
97100
}
98101

99102
- (void)restartOffline {
100103
@autoreleasepool {
101104
[FRepoManager disposeRepos:config];
105+
database = [FTestHelpers databaseForConfig:self->config];
102106
isOnline = NO;
103107
}
104108
}
@@ -134,8 +138,7 @@ - (void)waitForIdleUsingWaiter:(XCTest *)waiter {
134138

135139
- (void)do:(void (^)(FIRDatabaseReference *))action {
136140
@autoreleasepool {
137-
FIRDatabaseReference *ref = [[[[FIRDatabaseReference alloc] initWithConfig:self->config]
138-
database] referenceFromURL:self->url];
141+
FIRDatabaseReference *ref = [database referenceFromURL:self->url];
139142
if (!isOnline) {
140143
[FRepoManager interrupt:config];
141144
}

Example/Database/Tests/Helpers/FTestBase.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ - (void)setUp {
3535
[super setUp];
3636

3737
[FIRDatabase setLoggingEnabled:YES];
38-
_databaseURL = [[FIRApp defaultApp] options].databaseURL;
38+
_databaseURL = [FTestHelpers databaseURL];
3939

4040
// Disabled normally since they slow down the tests and don't actually assert anything (they just
4141
// NSLog timings).

Example/Database/Tests/Helpers/FTestHelpers.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@
3131
#define PATH(__path) [FPath pathWithString:(__path)]
3232

3333
@interface FTestHelpers : XCTestCase
34+
+ (NSString *)databaseURL;
3435
+ (FIRDatabaseConfig *)defaultConfig;
3536
+ (FIRDatabaseConfig *)configForName:(NSString *)name;
37+
+ (FIRDatabase *)defaultDatabase;
38+
+ (FIRDatabase *)databaseForConfig:(FIRDatabaseConfig *)config;
3639
+ (FIRDatabaseReference *)getRandomNode;
3740
+ (FIRDatabaseReference *)getRandomNodeWithoutPersistence;
3841
+ (FTupleFirebase *)getRandomNodePair;

Example/Database/Tests/Helpers/FTestHelpers.m

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#import "FConstants.h"
2626
#import "FIRAuthInteropFake.h"
2727
#import "FIRDatabaseConfig_Private.h"
28+
#import "FIRDatabase_Private.h"
2829
#import "FTestAuthTokenGenerator.h"
2930

3031
@implementation FTestHelpers
@@ -60,6 +61,28 @@ + (FIRDatabaseConfig *)configForName:(NSString *)name {
6061
authTokenProvider:authTokenProvider];
6162
}
6263

64+
+ (NSString *)databaseURL {
65+
FIROptions *options = [FIROptions defaultOptions];
66+
if (options && ![options.databaseURL isEqualToString:@"https://abc-xyz-123.firebaseio.com"]) {
67+
return options.databaseURL;
68+
}
69+
// If no custom GoogleServices.plist is provided, we default to the Emulator URL.
70+
return @"http://localhost:9000";
71+
}
72+
73+
+ (FIRDatabase *)databaseForConfig:(FIRDatabaseConfig *)config {
74+
FParsedUrl *parsedUrl = [FUtilities parseUrl:[FTestHelpers databaseURL]];
75+
return [FIRDatabase createDatabaseForTests:parsedUrl.repoInfo config:config];
76+
}
77+
78+
+ (FIRDatabase *)defaultDatabase {
79+
static FIRDatabase *database = nil;
80+
if (database == nil) {
81+
database = [FTestHelpers databaseForConfig:[self defaultConfig]];
82+
}
83+
return database;
84+
}
85+
6386
+ (NSArray *)getRandomNodes:(int)num persistence:(BOOL)persistence {
6487
static dispatch_once_t pred = 0;
6588
static NSMutableArray *persistenceRefs = nil;
@@ -73,18 +96,13 @@ + (NSArray *)getRandomNodes:(int)num persistence:(BOOL)persistence {
7396

7497
NSMutableArray *refs = (persistence) ? persistenceRefs : noPersistenceRefs;
7598

76-
id<FIRAuthInterop> auth = [[FIRAuthInteropFake alloc] initWithToken:nil userID:nil error:nil];
77-
id<FAuthTokenProvider> authTokenProvider = [FAuthTokenProvider authTokenProviderWithAuth:auth];
78-
7999
while (num > refs.count) {
80100
NSString *sessionIdentifier =
81101
[NSString stringWithFormat:@"test-config-%@persistence-%lu", (persistence) ? @"" : @"no-",
82102
(unsigned long)refs.count];
83-
FIRDatabaseConfig *config =
84-
[[FIRDatabaseConfig alloc] initWithSessionIdentifier:sessionIdentifier
85-
authTokenProvider:authTokenProvider];
103+
FIRDatabaseConfig *config = [self configForName:sessionIdentifier];
86104
config.persistenceEnabled = persistence;
87-
FIRDatabaseReference *ref = [[FIRDatabaseReference alloc] initWithConfig:config];
105+
FIRDatabaseReference *ref = [[self databaseForConfig:config] reference];
88106
[refs addObject:ref];
89107
}
90108

Example/Database/Tests/Integration/FData.m

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ - (void)testProperParamChecking {
6363

6464
- (void)testNamespaceCaseInsensitivityWithinARepo {
6565
FIRDatabaseReference *ref1 =
66-
[[FIRDatabase database] referenceFromURL:[self.databaseURL uppercaseString]];
66+
[[FTestHelpers defaultDatabase] referenceFromURL:[self.databaseURL uppercaseString]];
6767
FIRDatabaseReference *ref2 =
68-
[[FIRDatabase database] referenceFromURL:[self.databaseURL lowercaseString]];
68+
[[FTestHelpers defaultDatabase] referenceFromURL:[self.databaseURL lowercaseString]];
6969

7070
XCTAssertTrue([ref1.description isEqualToString:ref2.description], @"Descriptions should match");
7171
}
@@ -212,7 +212,8 @@ - (void)testSnapshotRef {
212212
- (void)testWriteLeafNodeOverwriteAtParentVerifyExpectedEvents {
213213
FIRDatabaseReference *node = [FTestHelpers getRandomNode];
214214

215-
FIRDatabaseReference *connected = [[[FIRDatabase database] reference] child:@".info/connected"];
215+
FIRDatabaseReference *connected =
216+
[[[FTestHelpers defaultDatabase] reference] child:@".info/connected"];
216217
__block BOOL ready = NO;
217218
[connected observeEventType:FIRDataEventTypeValue
218219
withBlock:^(FIRDataSnapshot *snapshot) {
@@ -1445,10 +1446,10 @@ - (void)testToString {
14451446
FIRDatabaseReference *ref = [FTestHelpers getRandomNode];
14461447
FIRDatabaseReference *parent = [ref parent];
14471448

1448-
XCTAssertTrue([[parent description] isEqualToString:self.databaseURL], @"Expect domain");
1449+
XCTAssertEqualObjects([parent description], self.databaseURL);
14491450
FIRDatabaseReference *child = [parent child:@"a/b/c"];
14501451
NSString *expected = [NSString stringWithFormat:@"%@/a/b/c", self.databaseURL];
1451-
XCTAssertTrue([[child description] isEqualToString:expected], @"Expected path");
1452+
XCTAssertEqualObjects([child description], expected);
14521453
}
14531454

14541455
- (void)testURLEncodingOfDescriptionAndURLDecodingOfNewFirebase {
@@ -1458,7 +1459,7 @@ - (void)testURLEncodingOfDescriptionAndURLDecodingOfNewFirebase {
14581459
NSString *expected1 = [NSString
14591460
stringWithFormat:@"%@/a%%25b%%26c%%40d/space%%3A%%20/non-ascii_character%%3A%%C3%%B8",
14601461
self.databaseURL];
1461-
FIRDatabaseReference *ref = [[FIRDatabase database] referenceFromURL:test1];
1462+
FIRDatabaseReference *ref = [[FTestHelpers defaultDatabase] referenceFromURL:test1];
14621463
NSString *result = [ref description];
14631464
XCTAssertTrue([result isEqualToString:expected1], @"Encodes properly");
14641465

@@ -1467,7 +1468,7 @@ - (void)testURLEncodingOfDescriptionAndURLDecodingOfNewFirebase {
14671468
[[ref child:path] setValue:@"testdata"
14681469
withCompletionBlock:^(NSError *error, FIRDatabaseReference *childRef) {
14691470
FIRDatabaseReference *other =
1470-
[[FIRDatabase database] referenceFromURL:[ref description]];
1471+
[[FTestHelpers defaultDatabase] referenceFromURL:[ref description]];
14711472
[[other child:path] observeEventType:FIRDataEventTypeValue
14721473
withBlock:^(FIRDataSnapshot *snapshot) {
14731474
NSString *val = snapshot.value;
@@ -1483,7 +1484,7 @@ - (void)testURLEncodingOfDescriptionAndURLDecodingOfNewFirebase {
14831484
}
14841485

14851486
- (void)testNameAtRootAndNonRootLocations {
1486-
FIRDatabaseReference *ref = [[FIRDatabase database] referenceFromURL:self.databaseURL];
1487+
FIRDatabaseReference *ref = [[FTestHelpers defaultDatabase] referenceFromURL:self.databaseURL];
14871488
XCTAssertTrue(ref.key == nil, @"Root key should be nil");
14881489
FIRDatabaseReference *child = [ref child:@"a"];
14891490
XCTAssertTrue([child.key isEqualToString:@"a"], @"Should be 'a'");
@@ -1492,7 +1493,7 @@ - (void)testNameAtRootAndNonRootLocations {
14921493
}
14931494

14941495
- (void)testNameAndRefOnSnapshotsForRootAndNonRootLocations {
1495-
FIRDatabaseReference *ref = [[FIRDatabase database] reference];
1496+
FIRDatabaseReference *ref = [[FTestHelpers defaultDatabase] reference];
14961497

14971498
__block BOOL ready = NO;
14981499
[ref removeValueWithCompletionBlock:^(NSError *error, FIRDatabaseReference *ref) {
@@ -3062,7 +3063,7 @@ - (void)testUpdateAfterChildSet {
30623063
- (void)testDeltaSyncNoDataUpdatesAfterReconnect {
30633064
FIRDatabaseReference *ref = [FTestHelpers getRandomNode];
30643065
FIRDatabaseConfig *cfg = [FTestHelpers configForName:@"test-config"];
3065-
FIRDatabaseReference *ref2 = [[[FIRDatabaseReference alloc] initWithConfig:cfg] child:ref.key];
3066+
FIRDatabaseReference *ref2 = [[FTestHelpers databaseForConfig:cfg] referenceWithPath:ref.key];
30663067
__block id data = @{@"a" : @1, @"b" : @2, @"c" : @{@".priority" : @3, @".value" : @3}, @"d" : @4};
30673068
[self waitForCompletionOf:ref setValue:data];
30683069

Example/Database/Tests/Integration/FDotInfo.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ - (void)testCanWatchInfoConnected {
5656

5757
- (void)testInfoConnectedGoesToFalseOnDisconnect {
5858
FIRDatabaseConfig *cfg = [FTestHelpers configForName:@"test-config"];
59-
FIRDatabaseReference *rootRef = [[FIRDatabaseReference alloc] initWithConfig:cfg];
59+
FIRDatabaseReference *rootRef = [[FTestHelpers databaseForConfig:cfg] reference];
6060
__block BOOL everConnected = NO;
6161
__block NSMutableString *connectedHistory = [[NSMutableString alloc] init];
6262
[[rootRef child:@".info/connected"]
@@ -87,7 +87,7 @@ - (void)testInfoConnectedGoesToFalseOnDisconnect {
8787

8888
- (void)testInfoServerTimeOffset {
8989
FIRDatabaseConfig *cfg = [FTestHelpers configForName:@"test-config"];
90-
FIRDatabaseReference *ref = [[FIRDatabaseReference alloc] initWithConfig:cfg];
90+
FIRDatabaseReference *ref = [[FTestHelpers databaseForConfig:cfg] reference];
9191

9292
// make sure childByAutoId works
9393
[ref childByAutoId];
@@ -116,8 +116,8 @@ - (void)testManualConnectionManagement {
116116
FIRDatabaseConfig *cfg = [FTestHelpers configForName:@"test-config"];
117117
FIRDatabaseConfig *altCfg = [FTestHelpers configForName:@"alt-config"];
118118

119-
FIRDatabaseReference *ref = [[FIRDatabaseReference alloc] initWithConfig:cfg];
120-
FIRDatabaseReference *refAlt = [[FIRDatabaseReference alloc] initWithConfig:altCfg];
119+
FIRDatabaseReference *ref = [[FTestHelpers databaseForConfig:cfg] reference];
120+
FIRDatabaseReference *refAlt = [[FTestHelpers databaseForConfig:altCfg] reference];
121121

122122
// Wait until we're connected to both Firebases
123123
__block BOOL ready = NO;
@@ -168,7 +168,7 @@ - (void)testManualConnectionManagement {
168168
}];
169169

170170
// Ensure that we don't automatically reconnect upon new Firebase creation
171-
FIRDatabaseReference *refDup = [[FIRDatabaseReference alloc] initWithConfig:altCfg];
171+
FIRDatabaseReference *refDup = [[refAlt database] reference];
172172
[[refDup child:@".info/connected"] observeEventType:FIRDataEventTypeValue
173173
withBlock:^(FIRDataSnapshot *snapshot) {
174174
if ([[snapshot value] boolValue]) {

Example/Database/Tests/Integration/FIRAuthTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ - (void)testListensAndAuthRaceCondition {
5050
FIRDatabaseConfig *config = [FTestHelpers configForName:@"testWritesRestoredAfterAuth"];
5151
config.authTokenProvider = authTokenProvider;
5252

53-
FIRDatabaseReference *ref = [[[FIRDatabaseReference alloc] initWithConfig:config] childByAutoId];
53+
FIRDatabaseReference *ref = [[[FTestHelpers databaseForConfig:config] reference] childByAutoId];
5454

5555
__block BOOL done = NO;
5656

Example/Database/Tests/Integration/FIRDatabaseTests.m

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ - (FIRDatabaseReference *)rootRefWithEngine:(id<FStorageEngine>)engine name:(NSS
184184
FIRDatabaseConfig *config = [FTestHelpers configForName:name];
185185
config.persistenceEnabled = YES;
186186
config.forceStorageEngine = engine;
187-
return [[FIRDatabaseReference alloc] initWithConfig:config];
187+
return [[FTestHelpers databaseForConfig:config] reference];
188188
}
189189

190190
- (void)testPurgeWritesPurgesAllWrites {
@@ -474,15 +474,14 @@ - (FIRDatabase *)databaseForURL:(NSString *)url {
474474
}
475475

476476
- (FIRDatabase *)databaseForURL:(NSString *)url name:(NSString *)name {
477-
id app = nil;
478477
NSString *defaultDatabaseURL = [NSString stringWithFormat:@"url:%@", self.databaseURL];
479478
if ([url isEqualToString:self.databaseURL] && [name isEqualToString:defaultDatabaseURL]) {
480479
// Use the default app for the default URL to avoid getting out of sync with FRepoManager
481480
// when calling ensureRepo during tests that don't create their own FIRFakeApp.
482-
app = [FIRApp defaultApp];
481+
return [FTestHelpers defaultDatabase];
483482
} else {
484-
app = [[FIRFakeApp alloc] initWithName:name URL:url];
483+
id app = [[FIRFakeApp alloc] initWithName:name URL:url];
484+
return [FIRDatabase databaseForApp:app];
485485
}
486-
return [FIRDatabase databaseForApp:app];
487486
}
488487
@end

Example/Database/Tests/Integration/FRealtime.m

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ - (void)testOnDisconnectSetWorks {
8484
FIRDatabaseConfig *readerCfg = [FTestHelpers configForName:@"reader"];
8585

8686
FIRDatabaseReference *writer =
87-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
87+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
8888
FIRDatabaseReference *reader =
89-
[[[FIRDatabaseReference alloc] initWithConfig:readerCfg] child:writer.key];
89+
[[[FTestHelpers databaseForConfig:readerCfg] reference] child:writer.key];
9090

9191
__block NSNumber *readValue = @0;
9292
__block NSNumber *writeValue = @0;
@@ -150,9 +150,9 @@ - (void)testOnDisconnectSetWithPriorityWorks {
150150
FIRDatabaseConfig *readerCfg = [FTestHelpers configForName:@"reader"];
151151

152152
FIRDatabaseReference *writer =
153-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
153+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
154154
FIRDatabaseReference *reader =
155-
[[[FIRDatabaseReference alloc] initWithConfig:readerCfg] child:writer.key];
155+
[[[FTestHelpers databaseForConfig:readerCfg] reference] child:writer.key];
156156

157157
__block BOOL sawNewValue = NO;
158158
__block BOOL writerSawNewValue = NO;
@@ -206,9 +206,9 @@ - (void)testOnDisconnectRemoveWorks {
206206
FIRDatabaseConfig *readerCfg = [FTestHelpers configForName:@"reader"];
207207

208208
FIRDatabaseReference *writer =
209-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
209+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
210210
FIRDatabaseReference *reader =
211-
[[[FIRDatabaseReference alloc] initWithConfig:readerCfg] child:writer.key];
211+
[[[FTestHelpers databaseForConfig:readerCfg] reference] child:writer.key];
212212

213213
__block BOOL ready = NO;
214214
[[writer child:@"foo"] setValue:@"bar"
@@ -259,9 +259,9 @@ - (void)testOnDisconnectUpdateWorks {
259259
FIRDatabaseConfig *readerCfg = [FTestHelpers configForName:@"reader"];
260260

261261
FIRDatabaseReference *writer =
262-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
262+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
263263
FIRDatabaseReference *reader =
264-
[[[FIRDatabaseReference alloc] initWithConfig:readerCfg] child:writer.key];
264+
[[[FTestHelpers databaseForConfig:readerCfg] reference] child:writer.key];
265265

266266
[self waitForCompletionOf:[writer child:@"foo"] setValue:@{@"bar" : @"a", @"baz" : @"b"}];
267267

@@ -313,7 +313,7 @@ - (void)testOnDisconnectUpdateWorks {
313313
- (void)testOnDisconnectTriggersSingleLocalValueEventForWriter {
314314
FIRDatabaseConfig *writerCfg = [FTestHelpers configForName:@"writer"];
315315
FIRDatabaseReference *writer =
316-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
316+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
317317

318318
__block int calls = 0;
319319
[writer observeEventType:FIRDataEventTypeValue
@@ -361,7 +361,7 @@ - (void)testOnDisconnectTriggersSingleLocalValueEventForReader {
361361
FIRDatabaseConfig *writerCfg = [FTestHelpers configForName:@"writer"];
362362
FIRDatabaseReference *reader = [FTestHelpers getRandomNode];
363363
FIRDatabaseReference *writer =
364-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] child:reader.key];
364+
[[[FTestHelpers databaseForConfig:writerCfg] reference] child:reader.key];
365365

366366
__block int calls = 0;
367367
[reader observeEventType:FIRDataEventTypeValue
@@ -408,7 +408,7 @@ - (void)testOnDisconnectTriggersSingleLocalValueEventForReader {
408408
- (void)testOnDisconnectTriggersSingleLocalValueEventForWriterWithQuery {
409409
FIRDatabaseConfig *writerCfg = [FTestHelpers configForName:@"writer"];
410410
FIRDatabaseReference *writer =
411-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
411+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
412412

413413
__block int calls = 0;
414414
[[[writer child:@"foo"] queryLimitedToLast:2]
@@ -457,7 +457,7 @@ - (void)testOnDisconnectTriggersSingleLocalValueEventForReaderWithQuery {
457457
FIRDatabaseReference *reader = [FTestHelpers getRandomNode];
458458
FIRDatabaseConfig *writerCfg = [FTestHelpers configForName:@"writer"];
459459
FIRDatabaseReference *writer =
460-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] child:reader.key];
460+
[[[FTestHelpers databaseForConfig:writerCfg] reference] child:reader.key];
461461

462462
__block int calls = 0;
463463
[[[reader child:@"foo"] queryLimitedToLast:2]
@@ -507,7 +507,7 @@ - (void)testOnDisconnectDeepMergeTriggersOnlyOneValueEventForReaderWithQuery {
507507
FIRDatabaseReference *reader = [FTestHelpers getRandomNode];
508508
FIRDatabaseConfig *writerCfg = [FTestHelpers configForName:@"writer"];
509509
FIRDatabaseReference *writer =
510-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
510+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
511511

512512
__block BOOL done = NO;
513513
NSDictionary *toSet =
@@ -552,9 +552,9 @@ - (void)testOnDisconnectCancelWorks {
552552
FIRDatabaseConfig *readerCfg = [FTestHelpers configForName:@"reader"];
553553

554554
FIRDatabaseReference *writer =
555-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
555+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
556556
FIRDatabaseReference *reader =
557-
[[[FIRDatabaseReference alloc] initWithConfig:readerCfg] child:writer.key];
557+
[[[FTestHelpers databaseForConfig:readerCfg] reference] child:writer.key];
558558

559559
__block BOOL ready = NO;
560560
[[writer child:@"foo"] setValue:@{@"bar" : @"a", @"baz" : @"b"}
@@ -614,7 +614,7 @@ - (void)testOnDisconnectCancelWorks {
614614
- (void)testOnDisconnectWithServerValuesWithLocalEvents {
615615
FIRDatabaseConfig *writerCfg = [FTestHelpers configForName:@"writer"];
616616
FIRDatabaseReference *node =
617-
[[[FIRDatabaseReference alloc] initWithConfig:writerCfg] childByAutoId];
617+
[[[FTestHelpers databaseForConfig:writerCfg] reference] childByAutoId];
618618

619619
__block FIRDataSnapshot *snap = nil;
620620
[node observeEventType:FIRDataEventTypeValue

0 commit comments

Comments
 (0)