Skip to content

Commit 66252e9

Browse files
committed
added test phone number from sample app
1 parent 1dde83b commit 66252e9

File tree

2 files changed

+40
-9
lines changed

2 files changed

+40
-9
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CLIENT_ID</key>
6+
<string>558150562999-qmutin4jbpcs78t2p68jj95qt2k9q9cs.apps.googleusercontent.com</string>
7+
<key>REVERSED_CLIENT_ID</key>
8+
<string>com.googleusercontent.apps.558150562999-qmutin4jbpcs78t2p68jj95qt2k9q9cs</string>
9+
<key>API_KEY</key>
10+
<string>AIzaSyD3Y3EiFWFmtagF9Y_VGWOa71GiAf9SJtA</string>
11+
<key>GCM_SENDER_ID</key>
12+
<string>558150562999</string>
13+
<key>PLIST_VERSION</key>
14+
<string>1</string>
15+
<key>BUNDLE_ID</key>
16+
<string>com.google.firebaseAuthSDKSampleApp.dev</string>
17+
<key>PROJECT_ID</key>
18+
<string>fir-ios-auth-sample</string>
19+
<key>STORAGE_BUCKET</key>
20+
<string>fir-ios-auth-sample.appspot.com</string>
21+
<key>IS_ADS_ENABLED</key>
22+
<false></false>
23+
<key>IS_ANALYTICS_ENABLED</key>
24+
<false></false>
25+
<key>IS_APPINVITE_ENABLED</key>
26+
<true></true>
27+
<key>IS_GCM_ENABLED</key>
28+
<true></true>
29+
<key>IS_SIGNIN_ENABLED</key>
30+
<true></true>
31+
<key>GOOGLE_APP_ID</key>
32+
<string>1:558150562999:ios:b7a8bbf5fad1845d2cc932</string>
33+
</dict>
34+
</plist>

FirebaseAuth/Tests/SampleSwift/SwiftApiTests/PhoneAuthTest.swift

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
// PhoneAuthTest.swift
17-
// SwiftApiTests
1816

1917
import FirebaseAuth
2018
import Foundation
2119
import XCTest
2220

2321
class PhoneAuthTests: TestsBase {
24-
let kPhoneNumber = "+19999999999"
22+
let phoneNumber = "+12345678910"
2523
// This test verification code is specified for the given test phone number in the developer
2624
// console.
27-
let kVerificationCode = "777777"
25+
let verificationCode = "123456"
2826

2927
func testSignInWithPhoneNumber() throws {
3028
Auth.auth().settings?.isAppVerificationDisabledForTesting = true // toAdd
@@ -33,7 +31,7 @@ class PhoneAuthTests: TestsBase {
3331

3432
// PhoneAuthProvider used to initiate the Verification process and obtain a verificationID.
3533
PhoneAuthProvider.provider()
36-
.verifyPhoneNumber(kPhoneNumber, uiDelegate: nil) { verificationID, error in
34+
.verifyPhoneNumber(phoneNumber, uiDelegate: nil) { verificationID, error in
3735
if let error {
3836
XCTAssertNil(error, "Verification error should be nil")
3937
XCTAssertNotNil(verificationID, "Verification ID should not be nil")
@@ -42,17 +40,17 @@ class PhoneAuthTests: TestsBase {
4240
// Create a credential using the test verification code.
4341
let credential = PhoneAuthProvider.provider().credential(
4442
withVerificationID: verificationID ?? "",
45-
verificationCode: self.kVerificationCode
43+
verificationCode: self.verificationCode
4644
)
47-
// signs in using the credential and verifies that the user is signed in correctly by
45+
// Signs in using the credential and verifies that the user is signed in correctly by
4846
// checking auth.currentUser.
4947
auth.signIn(with: credential) { authResult, error in
5048
if let error {
5149
XCTAssertNil(error, "Sign in error should be nil")
5250
XCTAssertNotNil(authResult, "AuthResult should not be nil")
5351
XCTAssertEqual(
5452
auth.currentUser?.phoneNumber,
55-
self.kPhoneNumber,
53+
self.phoneNumber,
5654
"Phone number does not match"
5755
)
5856
}
@@ -61,6 +59,5 @@ class PhoneAuthTests: TestsBase {
6159
}
6260

6361
waitForExpectations(timeout: TestsBase.kExpectationsTimeout)
64-
// deleteCurrentUser()
6562
}
6663
}

0 commit comments

Comments
 (0)