Skip to content

Commit

Permalink
implement FirebaseDatabase.ref()
Browse files Browse the repository at this point in the history
  • Loading branch information
sitatec committed Dec 14, 2021
1 parent 043820e commit 28c0a3c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/src/mock_firebase_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ class MockFirebaseDatabase extends Mock implements FirebaseDatabase {
static FirebaseDatabase get instance => MockFirebaseDatabase();
static get persistData => _persistData;
@override
DatabaseReference reference() => MockDatabaseReference();
DatabaseReference reference() => ref();

DatabaseReference ref([String? path]) {
if (path != null) {
return MockDatabaseReference()..child(path);
}
return MockDatabaseReference();
}

// ignore: unused_field
static bool _persistData = true;
//Todo support non persistence.
Expand Down

0 comments on commit 28c0a3c

Please sign in to comment.