Skip to content

Commit 53505d1

Browse files
authored
Fixed setting up mocks with the new firebase_core_platform_interface (#6)
* Fixed setting up mocks with the new firebase_core_platform_interface version * Updated per code review. Fixed some lint issues. * Updated main.yaml - Use the latest stable flutter - Changed `runs-on` from `macos-latest` to `ubuntu-latest` to minimize actions time spent as macos minute is treated as 10 ubuntu minutes * Updated per PR comment from @sitatec
1 parent 5b54199 commit 53505d1

File tree

6 files changed

+63
-79
lines changed

6 files changed

+63
-79
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# This workflow contains a single job called "build"
1919
build:
2020
# The type of runner that the job will run on
21-
runs-on: macos-latest
21+
runs-on: ubuntu-latest
2222

2323
# Steps represent a sequence of tasks that will be executed as part of the job
2424
steps:
@@ -30,7 +30,9 @@ jobs:
3030

3131
# Runs a single command using the runners shell
3232
- name: Install Flutter
33-
uses: subosito/flutter-action@v1
33+
uses: subosito/flutter-action@v2
34+
with:
35+
channel: 'stable'
3436

3537
- name: Install dependencies
3638
run: flutter pub get

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.3
2+
* Fixed setting up mocks with the new firebase_core_platform_interface version
3+
* Updated dependencies
4+
* Fix some lint issues
15
## 0.3.2
26
* fix and test MockFirebaseDatabase.instance.ref()
37
## 0.3.1

lib/src/set_up_mocks.dart

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,5 @@ void setupFirebaseMocks() {
66
TestWidgetsFlutterBinding.ensureInitialized();
77

88
// ignore: invalid_use_of_visible_for_testing_member
9-
MethodChannelFirebase.channel.setMockMethodCallHandler((call) async {
10-
if (call.method == 'Firebase#initializeCore') {
11-
return [
12-
{
13-
'name': defaultFirebaseAppName,
14-
'options': {
15-
'apiKey': '123',
16-
'appId': '123',
17-
'messagingSenderId': '123',
18-
'projectId': '123',
19-
},
20-
'pluginConstants': {},
21-
}
22-
];
23-
}
24-
25-
if (call.method == 'Firebase#initializeApp') {
26-
return {
27-
'name': call.arguments['appName'],
28-
'options': call.arguments['options'],
29-
'pluginConstants': {},
30-
};
31-
}
32-
return null;
33-
});
9+
setupFirebaseCoreMocks();
3410
}

pubspec.lock

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ packages:
77
name: _fe_analyzer_shared
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "31.0.0"
10+
version: "41.0.0"
1111
analyzer:
1212
dependency: transitive
1313
description:
1414
name: analyzer
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.8.0"
17+
version: "4.2.0"
1818
args:
1919
dependency: transitive
2020
description:
2121
name: args
2222
url: "https://pub.dartlang.org"
2323
source: hosted
24-
version: "2.3.0"
24+
version: "2.3.1"
2525
async:
2626
dependency: transitive
2727
description:
2828
name: async
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "2.8.1"
31+
version: "2.8.2"
3232
boolean_selector:
3333
dependency: transitive
3434
description:
@@ -42,7 +42,7 @@ packages:
4242
name: build
4343
url: "https://pub.dartlang.org"
4444
source: hosted
45-
version: "2.1.1"
45+
version: "2.3.0"
4646
built_collection:
4747
dependency: transitive
4848
description:
@@ -56,28 +56,21 @@ packages:
5656
name: built_value
5757
url: "https://pub.dartlang.org"
5858
source: hosted
59-
version: "8.1.3"
59+
version: "8.4.0"
6060
characters:
6161
dependency: transitive
6262
description:
6363
name: characters
6464
url: "https://pub.dartlang.org"
6565
source: hosted
66-
version: "1.1.0"
66+
version: "1.2.0"
6767
charcode:
6868
dependency: transitive
6969
description:
7070
name: charcode
7171
url: "https://pub.dartlang.org"
7272
source: hosted
7373
version: "1.3.1"
74-
cli_util:
75-
dependency: transitive
76-
description:
77-
name: cli_util
78-
url: "https://pub.dartlang.org"
79-
source: hosted
80-
version: "0.3.5"
8174
clock:
8275
dependency: transitive
8376
description:
@@ -98,35 +91,35 @@ packages:
9891
name: collection
9992
url: "https://pub.dartlang.org"
10093
source: hosted
101-
version: "1.15.0"
94+
version: "1.16.0"
10295
convert:
10396
dependency: transitive
10497
description:
10598
name: convert
10699
url: "https://pub.dartlang.org"
107100
source: hosted
108-
version: "3.0.1"
101+
version: "3.0.2"
109102
crypto:
110103
dependency: transitive
111104
description:
112105
name: crypto
113106
url: "https://pub.dartlang.org"
114107
source: hosted
115-
version: "3.0.1"
108+
version: "3.0.2"
116109
dart_style:
117110
dependency: transitive
118111
description:
119112
name: dart_style
120113
url: "https://pub.dartlang.org"
121114
source: hosted
122-
version: "2.2.0"
115+
version: "2.2.3"
123116
fake_async:
124117
dependency: transitive
125118
description:
126119
name: fake_async
127120
url: "https://pub.dartlang.org"
128121
source: hosted
129-
version: "1.2.0"
122+
version: "1.3.0"
130123
file:
131124
dependency: transitive
132125
description:
@@ -140,63 +133,63 @@ packages:
140133
name: firebase_core
141134
url: "https://pub.dartlang.org"
142135
source: hosted
143-
version: "1.10.5"
136+
version: "1.19.2"
144137
firebase_core_platform_interface:
145138
dependency: "direct main"
146139
description:
147140
name: firebase_core_platform_interface
148141
url: "https://pub.dartlang.org"
149142
source: hosted
150-
version: "4.2.2"
143+
version: "4.4.3"
151144
firebase_core_web:
152145
dependency: transitive
153146
description:
154147
name: firebase_core_web
155148
url: "https://pub.dartlang.org"
156149
source: hosted
157-
version: "1.5.2"
150+
version: "1.7.0"
158151
firebase_database:
159152
dependency: "direct main"
160153
description:
161154
name: firebase_database
162155
url: "https://pub.dartlang.org"
163156
source: hosted
164-
version: "9.0.3"
157+
version: "9.0.19"
165158
firebase_database_platform_interface:
166159
dependency: transitive
167160
description:
168161
name: firebase_database_platform_interface
169162
url: "https://pub.dartlang.org"
170163
source: hosted
171-
version: "0.2.0+2"
164+
version: "0.2.1+11"
172165
firebase_database_web:
173166
dependency: transitive
174167
description:
175168
name: firebase_database_web
176169
url: "https://pub.dartlang.org"
177170
source: hosted
178-
version: "0.2.0+2"
171+
version: "0.2.1"
179172
fixnum:
180173
dependency: transitive
181174
description:
182175
name: fixnum
183176
url: "https://pub.dartlang.org"
184177
source: hosted
185-
version: "1.0.0"
178+
version: "1.0.1"
186179
flutter:
187180
dependency: "direct main"
188181
description: flutter
189182
source: sdk
190183
version: "0.0.0"
191184
flutter_lints:
192-
dependency: "direct main"
185+
dependency: "direct dev"
193186
description:
194187
name: flutter_lints
195188
url: "https://pub.dartlang.org"
196189
source: hosted
197-
version: "1.0.4"
190+
version: "2.0.1"
198191
flutter_test:
199-
dependency: "direct main"
192+
dependency: "direct dev"
200193
description: flutter
201194
source: sdk
202195
version: "0.0.0"
@@ -211,21 +204,21 @@ packages:
211204
name: glob
212205
url: "https://pub.dartlang.org"
213206
source: hosted
214-
version: "2.0.2"
207+
version: "2.1.0"
215208
js:
216209
dependency: transitive
217210
description:
218211
name: js
219212
url: "https://pub.dartlang.org"
220213
source: hosted
221-
version: "0.6.3"
214+
version: "0.6.4"
222215
lints:
223216
dependency: transitive
224217
description:
225218
name: lints
226219
url: "https://pub.dartlang.org"
227220
source: hosted
228-
version: "1.0.1"
221+
version: "2.0.0"
229222
logging:
230223
dependency: transitive
231224
description:
@@ -239,7 +232,14 @@ packages:
239232
name: matcher
240233
url: "https://pub.dartlang.org"
241234
source: hosted
242-
version: "0.12.10"
235+
version: "0.12.11"
236+
material_color_utilities:
237+
dependency: transitive
238+
description:
239+
name: material_color_utilities
240+
url: "https://pub.dartlang.org"
241+
source: hosted
242+
version: "0.1.4"
243243
meta:
244244
dependency: transitive
245245
description:
@@ -248,40 +248,40 @@ packages:
248248
source: hosted
249249
version: "1.7.0"
250250
mockito:
251-
dependency: "direct main"
251+
dependency: "direct dev"
252252
description:
253253
name: mockito
254254
url: "https://pub.dartlang.org"
255255
source: hosted
256-
version: "5.0.16"
256+
version: "5.2.0"
257257
package_config:
258258
dependency: transitive
259259
description:
260260
name: package_config
261261
url: "https://pub.dartlang.org"
262262
source: hosted
263-
version: "2.0.2"
263+
version: "2.1.0"
264264
path:
265265
dependency: transitive
266266
description:
267267
name: path
268268
url: "https://pub.dartlang.org"
269269
source: hosted
270-
version: "1.8.0"
270+
version: "1.8.1"
271271
plugin_platform_interface:
272272
dependency: transitive
273273
description:
274274
name: plugin_platform_interface
275275
url: "https://pub.dartlang.org"
276276
source: hosted
277-
version: "2.0.2"
277+
version: "2.1.2"
278278
pub_semver:
279279
dependency: transitive
280280
description:
281281
name: pub_semver
282282
url: "https://pub.dartlang.org"
283283
source: hosted
284-
version: "2.1.0"
284+
version: "2.1.1"
285285
sky_engine:
286286
dependency: transitive
287287
description: flutter
@@ -293,14 +293,14 @@ packages:
293293
name: source_gen
294294
url: "https://pub.dartlang.org"
295295
source: hosted
296-
version: "1.2.0"
296+
version: "1.2.2"
297297
source_span:
298298
dependency: transitive
299299
description:
300300
name: source_span
301301
url: "https://pub.dartlang.org"
302302
source: hosted
303-
version: "1.8.1"
303+
version: "1.8.2"
304304
stack_trace:
305305
dependency: transitive
306306
description:
@@ -335,21 +335,21 @@ packages:
335335
name: test_api
336336
url: "https://pub.dartlang.org"
337337
source: hosted
338-
version: "0.4.2"
338+
version: "0.4.9"
339339
typed_data:
340340
dependency: transitive
341341
description:
342342
name: typed_data
343343
url: "https://pub.dartlang.org"
344344
source: hosted
345-
version: "1.3.0"
345+
version: "1.3.1"
346346
vector_math:
347347
dependency: transitive
348348
description:
349349
name: vector_math
350350
url: "https://pub.dartlang.org"
351351
source: hosted
352-
version: "2.1.0"
352+
version: "2.1.2"
353353
watcher:
354354
dependency: transitive
355355
description:
@@ -363,7 +363,7 @@ packages:
363363
name: yaml
364364
url: "https://pub.dartlang.org"
365365
source: hosted
366-
version: "3.1.0"
366+
version: "3.1.1"
367367
sdks:
368-
dart: ">=2.14.0 <3.0.0"
368+
dart: ">=2.17.0 <3.0.0"
369369
flutter: ">=1.20.0"

0 commit comments

Comments
 (0)