Skip to content

fix: Bump mockito to breaking change with fixes #4942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ dev_dependencies:
firebase_core_platform_interface: ">=4.0.0-1.0.nullsafety.1 <4.0.0-2.0.nullsafety.0"
flutter_test:
sdk: flutter
mockito: ^5.0.0-nullsafety.2
mockito: ^5.0.0-nullsafety.6
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ import '../utils/test_common.dart';
//ignore: avoid_implementing_value_types
class MockDocumentReference extends Mock implements DocumentReferencePlatform {
@override
String get path => super.noSuchMethod(Invocation.getter(#path), 'foo/bar');
String get path =>
super.noSuchMethod(Invocation.getter(#path), returnValue: 'foo/bar');
@override
String get id => super.noSuchMethod(Invocation.getter(#id), 'mock-id');
String get id =>
super.noSuchMethod(Invocation.getter(#id), returnValue: 'mock-id');
}

const _kTransactionId = '1022';
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_auth/firebase_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dev_dependencies:
async: ^2.5.0-nullsafety.3
flutter_test:
sdk: flutter
mockito: ^5.0.0-nullsafety.2
mockito: ^5.0.0-nullsafety.6
plugin_platform_interface: ^1.1.0-nullsafety.2
test: ^1.16.0-nullsafety.15

Expand Down
58 changes: 29 additions & 29 deletions packages/firebase_auth/firebase_auth/test/firebase_auth_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -651,31 +651,31 @@ class MockFirebaseAuth extends Mock
Stream<UserPlatform?> userChanges() {
return super.noSuchMethod(
Invocation.method(#userChanges, []),
const Stream<UserPlatform?>.empty(),
returnValue: const Stream<UserPlatform?>.empty(),
);
}

@override
Stream<UserPlatform?> idTokenChanges() {
return super.noSuchMethod(
Invocation.method(#idTokenChanges, []),
const Stream<UserPlatform?>.empty(),
returnValue: const Stream<UserPlatform?>.empty(),
);
}

@override
Stream<UserPlatform?> authStateChanges() {
return super.noSuchMethod(
Invocation.method(#authStateChanges, []),
const Stream<UserPlatform?>.empty(),
returnValue: const Stream<UserPlatform?>.empty(),
);
}

@override
FirebaseAuthPlatform delegateFor({FirebaseApp? app}) {
return super.noSuchMethod(
Invocation.method(#delegateFor, [], {#app: app}),
TestFirebaseAuthPlatform(),
returnValue: TestFirebaseAuthPlatform(),
);
}

Expand All @@ -686,7 +686,7 @@ class MockFirebaseAuth extends Mock
) {
return super.noSuchMethod(
Invocation.method(#createUserWithEmailAndPassword, [email, password]),
neverEndingFuture<UserCredentialPlatform>(),
returnValue: neverEndingFuture<UserCredentialPlatform>(),
);
}

Expand All @@ -700,7 +700,7 @@ class MockFirebaseAuth extends Mock
#signInWithPhoneNumber,
[phoneNumber, applicationVerifier],
),
neverEndingFuture<ConfirmationResultPlatform>(),
returnValue: neverEndingFuture<ConfirmationResultPlatform>(),
);
}

Expand All @@ -710,15 +710,15 @@ class MockFirebaseAuth extends Mock
) {
return super.noSuchMethod(
Invocation.method(#signInWithCredential, [credential]),
neverEndingFuture<UserCredentialPlatform>(),
returnValue: neverEndingFuture<UserCredentialPlatform>(),
);
}

@override
Future<UserCredentialPlatform> signInWithCustomToken(String? token) {
return super.noSuchMethod(
Invocation.method(#signInWithCustomToken, [token]),
neverEndingFuture<UserCredentialPlatform>(),
returnValue: neverEndingFuture<UserCredentialPlatform>(),
);
}

Expand All @@ -729,15 +729,15 @@ class MockFirebaseAuth extends Mock
) {
return super.noSuchMethod(
Invocation.method(#signInWithEmailAndPassword, [email, password]),
neverEndingFuture<UserCredentialPlatform>(),
returnValue: neverEndingFuture<UserCredentialPlatform>(),
);
}

@override
Future<UserCredentialPlatform> signInWithPopup(AuthProvider? provider) {
return super.noSuchMethod(
Invocation.method(#signInWithPopup, [provider]),
neverEndingFuture<UserCredentialPlatform>(),
returnValue: neverEndingFuture<UserCredentialPlatform>(),
);
}

Expand All @@ -748,23 +748,23 @@ class MockFirebaseAuth extends Mock
) {
return super.noSuchMethod(
Invocation.method(#signInWithEmailLink, [email, emailLink]),
neverEndingFuture<UserCredentialPlatform>(),
returnValue: neverEndingFuture<UserCredentialPlatform>(),
);
}

@override
Future<void> signInWithRedirect(AuthProvider? provider) {
return super.noSuchMethod(
Invocation.method(#signInWithRedirect, [provider]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

@override
Future<UserCredentialPlatform> signInAnonymously() {
return super.noSuchMethod(
Invocation.method(#signInAnonymously, []),
neverEndingFuture<UserCredentialPlatform>(),
returnValue: neverEndingFuture<UserCredentialPlatform>(),
);
}

Expand All @@ -778,63 +778,63 @@ class MockFirebaseAuth extends Mock
#currentUser: currentUser,
#languageCode: languageCode,
}),
TestFirebaseAuthPlatform(),
returnValue: TestFirebaseAuthPlatform(),
);
}

@override
Future<UserCredentialPlatform> getRedirectResult() {
return super.noSuchMethod(
Invocation.method(#getRedirectResult, []),
neverEndingFuture<UserCredentialPlatform>(),
returnValue: neverEndingFuture<UserCredentialPlatform>(),
);
}

@override
Future<void> setLanguageCode(String? languageCode) {
return super.noSuchMethod(
Invocation.method(#setLanguageCode, [languageCode]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

@override
Future<void> useEmulator(String host, int port) {
return super.noSuchMethod(
Invocation.method(#useEmulator, [host, port]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

@override
Future<ActionCodeInfo> checkActionCode(String? code) {
return super.noSuchMethod(
Invocation.method(#checkActionCode, [code]),
neverEndingFuture<ActionCodeInfo>(),
returnValue: neverEndingFuture<ActionCodeInfo>(),
);
}

@override
Future<void> confirmPasswordReset(String? code, String? newPassword) {
return super.noSuchMethod(
Invocation.method(#confirmPasswordReset, [code, newPassword]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

@override
Future<List<String>> fetchSignInMethodsForEmail(String? email) {
return super.noSuchMethod(
Invocation.method(#checkActionCode, [email]),
neverEndingFuture<List<String>>(),
returnValue: neverEndingFuture<List<String>>(),
);
}

@override
bool isSignInWithEmailLink(String? emailLink) {
return super.noSuchMethod(
Invocation.method(#isSignInWithEmailLink, [emailLink]),
false,
returnValue: false,
);
}

Expand All @@ -845,7 +845,7 @@ class MockFirebaseAuth extends Mock
]) {
return super.noSuchMethod(
Invocation.method(#sendPasswordResetEmail, [email, actionCodeSettings]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

Expand All @@ -856,7 +856,7 @@ class MockFirebaseAuth extends Mock
) {
return super.noSuchMethod(
Invocation.method(#sendSignInLinkToEmail, [email, actionCodeSettings]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

Expand All @@ -870,31 +870,31 @@ class MockFirebaseAuth extends Mock
appVerificationDisabledForTesting,
userAccessGroup,
]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

@override
Future<void> setPersistence(Persistence? persistence) {
return super.noSuchMethod(
Invocation.method(#setPersistence, [persistence]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

@override
Future<void> signOut() {
return super.noSuchMethod(
Invocation.method(#signOut, [signOut]),
neverEndingFuture<void>(),
returnValue: neverEndingFuture<void>(),
);
}

@override
Future<String> verifyPasswordResetCode(String? code) {
return super.noSuchMethod(
Invocation.method(#verifyPasswordResetCode, [code]),
neverEndingFuture<String>(),
returnValue: neverEndingFuture<String>(),
);
}

Expand All @@ -920,7 +920,7 @@ class MockFirebaseAuth extends Mock
#forceResendingToken: forceResendingToken,
#autoRetrievedSmsCodeForTesting: autoRetrievedSmsCodeForTesting,
}),
neverEndingFuture<String>(),
returnValue: neverEndingFuture<String>(),
);
}
}
Expand Down Expand Up @@ -1000,7 +1000,7 @@ class MockRecaptchaVerifier extends Mock
RecaptchaVerifierFactoryPlatform get delegate {
return super.noSuchMethod(
Invocation.getter(#delegate),
MockRecaptchaVerifierFactoryPlatform(),
returnValue: MockRecaptchaVerifierFactoryPlatform(),
);
}
}
Expand Down
Loading